HMS getToken returns null if app is installed from APPGALLERY - notifications

I build an app. I am using the HMS Push kit for notifications. It is working fine if I build apk and install it on a device directly. But if I install this app from Huawei AppGallery, it returns a null token to me.
To get Token I wrote this code:
String appId = AGConnectServicesConfig.fromContext(context).getString("client/app_id");
String token = HmsInstanceId.getInstance(context).getToken(appId, "HCM");
I do not know what is the problem with installing an app from AppGallery. I cross verified SHA-256 key, connect-services.json file, appid etc.
The app will work fine if I make debug or release apk and install it on a device. The app will return a null token if I will install it from AppGallery.

Could you pls check if the onNewToken method returns a token? To better locate this issue, Can you mind share the APK from AppGallery and detailed logcat logs for us to check? You could send the APK to hmscore#huawei.com.

Huawei is generating 2 SHA-256 keys, one locally. Second at App Signing module at developer account.
After adding second SHA-256 key, my issue was resolved.

Related

Android Google Login Working on Release signed Version But not Working On Release .aab file

I am getting the issue in .aab file only that google login is not working but in apk it is working properly.I am stucked from past 1 Week.I checked SHA-1 keys properly.i give both release and debug SHA-1 keys in firebase console and I already check those keys are inserted on google cloud console also.After I Created Released .aab version I checked on Browser Stack by installing .aab file but it always says Api Exception Error 10 .But when I try released signed apk it working good why this was happening please help me friends.

How to generate an ipa with expo (react native) for production?

i work for a key account and i'm a beginner in react native. I work on a PC and i use expo when i want to build an ipa for iOS . It's very easy for a development version but i'm stucked when i build for production.
I have the following error :
validateProvisioningProfile: provisioning profile is not associated with uploaded distribution certificate
The message seems very clear but it's not.
Actually, i've a dev account and i have to use a distribution profile from my organisation. My dev account is part of my organisation and i thought it was enough to pass the test but it's not. Help would be very appreciated. Thanks in advance.
You need to get Mac (not PC), open apple developer account and run in the project folder:
expo build:ios
you will get a url with an option to download ipa file

Update old apk with new

I currently have an app in the play store/app store but recently I started getting problems on my debug version so I decided to create a new react-native project and copy/paste all my code.
Can I build this APK/IPA from this new project and upload it to the store without problems? Will Android/Apple decline my request?
For Android as long as you use the same application id and the same keystore to sign the APK with you can recreate the app and submit it for review to add to store.
For Apple the important part is the bundle id. You need to set the bundle id as same and set the version number to correct one.

Build standalone app from React native projects

How do i create a standalone app for iOS (*.ipa) so that i can distribute it to friends / testers?
Is there a way to do this without paying 99$/annum to Apple?
I tried the solution where you have to create a directory called "Payload", archive it and then rename it to *.ipa. But, this did not work.
Expo has created a great solution to this problem. It's also great for development. They have a huge community on their slack channel. Download the expo app, and you can test on your own device, and send your app to your friends.
https://expo.io/
You could ask your friends to install the Expo App to test it
If you ask your friends to install the Expo app and you keep your Expo XDE open with your host selected as tunnel it should work. But if you switch of you xde the app will not work anymore. This is the only way.
The android apk can still be circulated to your friends without the license but for ios you will need to get the developers certificate and upload your app/get approval and only then can you ask people to test it out.

statusCode=unknown status code=9000 | Google Places API for Android

I am using the exact design example google place
https://github.com/googlesamples/android-play-places/tree/master/PlaceComplete
I added an api key with the package name and my SHA1 to generate the key
when I run the project via Android Studio on emulators Android works perfectly research.
I generate an apk and install on my device or BlueStacks I get this error statusCode=unknown status code=9000
Could someone tell me why this error only on my devices?