I am trying to implement feature to add Loyalty Card into Google Pay account from my React Native application. I am using this tutorial.
I successfully created custom Native package and module and my calls from JavaScript are working. Thats not my problem.
My problem is when I am calling Pay.getClient(this.getCurrentActivity());
. I get this error:
2021-07-29 21:38:40.695 17480-19373/com.examp.le E/GoogleApiManager: Failed to get service from broker.
java.lang.SecurityException: GoogleCertificatesRslt: Package signed with unknown certificate (go/gsrlt)
at android.os.Parcel.createException(Parcel.java:2071)
at android.os.Parcel.readException(Parcel.java:2039)
at android.os.Parcel.readException(Parcel.java:1987)
at com.google.android.gms.common.internal.IGmsServiceBroker$Stub$zza.getService(com.google.android.gms:play-services-basement@@17.5.0:14)
at com.google.android.gms.common.internal.BaseGmsClient.getRemoteService(com.google.android.gms:play-services-basement@@17.5.0:281)
at com.google.android.gms.common.api.internal.zabj.run(com.google.android.gms:play-services-base@@17.5.0:11)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.os.HandlerThread.run(HandlerThread.java:67)
Seems like this means that I cannot initialize/get GoogleApi access, because I am in debug mode (building my application in debug mode) and my certificate is not signed.
I found just very limited documentatin for com.google.android.gms:play-services-pay
package so I am not sure if I am even able to call this in debug/development environment.
Any idea how to make it work? Can it be caused by my Activity originating from React Native (ReactContextBaseJavaModule.getCurrentActivity()
)?
EDIT: Same error also on Release version with Google's keystore :(