Skip to content

Commit

Permalink
Merge pull request #326 from Shopify/bug/325-check_for_play_services
Browse files Browse the repository at this point in the history
check to see if we have Play Services available before trying to create Play Services Client
  • Loading branch information
krisorr authored Nov 11, 2016
2 parents 3308957 + cbc1aab commit d340905
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,12 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
* Create a Google Api client for use in Android Pay
*/
private void createGoogleAPIClient() {
googleApiClient = new GoogleApiClient.Builder(this)
if (AndroidPayHelper.hasGooglePlayServices(this)) {
googleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wallet.API, new Wallet.WalletOptions.Builder().build())
.enableAutoManage(this, this)
.build();
}
}

@Override
Expand Down

0 comments on commit d340905

Please sign in to comment.