'Huawei react-native Onsignal integration error "Your user failed to be subscribed"
I'm trying to configure "Huawei Android (HMS)" for my react-native app. I'm on the step 'Install the SDK'. A user got added but isn't subscribed, and the general error code is 'This user uninstalled your app or cleared site data.'.
Docs I followed: https://documentation.onesignal.com/docs/huawei-react-native-sdk-setup
Platform: Huawei Android (HMS)
SDK: React Native
react-native-onesignal: ^4.3.7,
Thanks in advance
Logs:
D/OneSignal: ActivityLifecycleHandler Handling lost focus
D/OneSignal: Application stopped focus time: 25213575 timeElapsed: 68
D/OneSignal: FocusTimeProcessorUnattributed:saveUnsentActiveData with lastFocusTimeInfluences: [SessionInfluence{influenceChannel=iam, influenceType=DISABLED, ids=null}, SessionInfluence{influenceChannel=notification, influenceType=DISABLED, ids=null}]
D/OneSignal: FocusTimeProcessorUnattributed:getUnsentActiveTime: 0
D/OneSignal: onActivityPaused: MainActivity@c9c8410
D/OneSignal: FocusTimeProcessorUnattributed:saveUnsentActiveTime: 68
D/OneSignal: curActivity is NOW: null
D/OneSignal: onActivityStopped: MainActivity@c9c8410
D/OneSignal: curActivity is NOW: null
D/OneSignal: Running destroyTimeout with runnable: com.onesignal.OSFocusHandler$startOnStopFocusWork$1@e53bf48
D/OneSignal: Running startTimeout with timeout: 1500 and runnable: com.onesignal.OSFocusHandler$startOnStopFocusWork$1@e53bf48
D/OneSignal: OSFocusHandler running onAppLostFocus
D/OneSignal: Application lost focus initDone: true
D/OneSignal: Last session time set to: 1645025753033
D/OneSignal: Application backgrounded focus time: 25213575
D/OneSignal: FocusTimeProcessorUnattributed:getUnsentActiveTime: 68
D/OneSignal: FocusTimeProcessorUnattributed:sendUnsentTimeNow with time: 68 and influences: []
D/OneSignal: FocusTimeProcessorUnattributed sendTime with: BACKGROUND
D/OneSignal: FocusTimeProcessorUnattributed:getUnsentActiveTime: 68
I/OneSignal: OSBackgroundSync scheduleSyncServiceAsJob:result: 1
D/OneSignal: OneSignal scheduleSyncService unsyncedChanges: false
D/OneSignal: LocationController scheduleUpdate not possible, location permission not enabled
D/OneSignal: OneSignal scheduleSyncService locationScheduled: false
D/OneSignal: OSFocusHandler setting stop state: true
D/OneSignal: OneSignal SDK initialization already completed.
D/OneSignal: UserStateSynchronizer internalSyncUserState from session call: false jsonBody: null
D/OneSignal: OSBackground sync, calling initWithContext
D/OneSignal: OneSignal SDK initialization already completed.
D/OneSignal: LocationController sendAndClearPromptHandlers from non prompt flow
D/OneSignal: UserStateSynchronizer internalSyncUserState from session call: false jsonBody: null
D/OneSignal: UserStateSynchronizer internalSyncUserState from session call: false jsonBody: {"app_id":"d440554b-5807-4b19-a66c-17019136987b","device_os":"9","timezone":10800,"timezone_id":"Europe\/Istanbul","language":"en","sdk":"040607","sdk_type":"react","android_package":"com.edtalk","device_model":"ART-L29","game_version":5,"net_type":0,"rooted":false}
I/OneSignal: Error updating the user record because of the null user id
D/OneSignal: UserStateSynchronizer internalSyncUserState from session call: false jsonBody: {"app_id":"d440554b-5807-4b19-a66c-17019136987b","device_os":"9","timezone":10800,"timezone_id":"Europe\/Istanbul","language":"en","sdk":"040607","sdk_type":"react","android_package":"com.edtalk","device_model":"ART-L29","game_version":5,"net_type":0,"rooted":false}
I/OneSignal: Error updating the user record because of the null user id
D/OneSignal: LollipopSyncRunnable:JobFinished needsJobReschedule: false
logs filtered by ‘hmssdk_’:
W/HMSSDK_PushPreferences: get new sharedPreferences failed,start to get from context.
I/HMSSDK_HMSPackageManager: aidlService pkgName: com.huawei.hwid
I/HMSSDK_HMSPackageManager: Enter getHMSPackageNameForMultiService
I/HMSSDK_HMSPackageManager: <initHmsPackageInfoForMultiService> Succeed to find HMS apk: com.huawei.hwid version: 60300326
I/HMSSDK_HMSPackageManager: enter asyncOnceCheckMDMState
I/HMSSDK_HMSPackageManager: enter checkHmsIsSpoof
I/HMSSDK_ReadApkFileUtil: verifyMDMSignatureV3 verify successful!
I/HMSSDK_HMSPackageManager: quit checkHmsIsSpoof state: SUCCESS
I/HMSSDK_HMSPackageManager: quit asyncOnceCheckMDMState
I/HMSSDK_HMSPackageManager: Enter getHMSPackageNameForMultiService
I/HMSSDK_HuaweiMobileServicesUtil: hmsPackageName is com.huawei.hwid
I/HMSSDK_HMSPackageManager: enter checkHmsIsSpoof
I/HMSSDK_HMSPackageManager: quit checkHmsIsSpoof cached state: SUCCESS
I/HMSSDK_HMSPackageManager: Enter getHMSPackageNameForMultiService
I/HMSSDK_HuaweiMobileServicesUtil: connect versionCode:60300326
I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
I/HMSSDK_HMSPackageManager: <initHmsPackageInfo> Succeed to find HMS apk: com.huawei.hwid version: 60300326
I/HMSSDK_HMSPackageManager: current versionCode:60300326, minimum version requirements: 30000100
I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
I/HMSSDK_HMSPackageManager: MinApkVersion is disabled.
I/HMSSDK_HMSPackageManager: Enter getHMSPackageNameForMultiService
I/HMSSDK_HuaweiMobileServicesUtil: hmsPackageName is com.huawei.hwid
I/HMSSDK_HMSPackageManager: enter checkHmsIsSpoof
I/HMSSDK_HMSPackageManager: quit checkHmsIsSpoof cached state: SUCCESS
I/HMSSDK_HMSPackageManager: Enter getHMSPackageNameForMultiService
I/HMSSDK_HuaweiMobileServicesUtil: connect versionCode:60300326
I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
I/HMSSDK_HMSPackageManager: current versionCode:60300326, minimum version requirements: 30000100
I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
I/HMSSDK_HMSPackageManager: Enter getHMSPackageName
I/HMSSDK_HMSPackageManager: MinApkVersion is disabled.
Solution 1:[1]
This sounds like a subscription issue that occurs when something hasn't been properly setup on the OneSignal console or app side. Make sure to check the HMS package name, HMS App ID, and HMS Client Secret are all set properly in the console or if these values are the same client side.
This guide shows you how to get the HMS Client Secret. https://medium.com/huawei-developers/integration-onesignal-with-huawei-push-kit-319ab5f943df
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zinna |
