OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

dashboard subscribe status different from SubscriptionObserver

Open CharlieZheng opened this issue 4 years ago • 3 comments

Description:

we integrate onesignal sdk, and it works fine. but there is an issue confuse us. when I toggle off the device system push button, our SubscriptionObserver receive the change indicate that the "to" object subscribe status is false and the "from" object subscribe status is true, but the dashboard indicate the device is subscribed, why? it should be unsubscribed in my opinion. can anyone explain this.

Environment

  1. we using onesignal v3.15.2

in PatpatApplication

OneSignal.startInit(this, xxx);

in app/build.gradle

dependencies { implementation 'com.onesignal:OneSignal:3.15.2@aar' }

CharlieZheng avatar Jul 27 '21 14:07 CharlieZheng

@CharlieZheng It possible the device was not able to make a network request to update the record on OneSignal's backend. Or it's possible that OneSignal did get the network request but was still processing the update.

Can you enable OneSignal's VERBOSE log with OneSignal.setLogLevel and share you logcat? We can check the network request in it to confirm if that is the issue.

jkasten2 avatar Jul 27 '21 18:07 jkasten2

hi @jkasten2 thanks for reply. I post some logcat here.

I toggle off the app system push button, then launch our app, onesignal log below

D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@77e4a15 D: GMSLocationController onFocusChange! D: OneSignal cleanOutcomes for session D: OneSignal save unattributedUniqueOutcomeEvents: [] D: OneSignal SessionManager restartSessionIfNeeded with entryAction: APP_OPEN channelTrackers: [OSChannelTracker{tag=notification_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}, OSChannelTracker{tag=iam_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}] D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: OneSignal SessionManager restartSessionIfNeeded lastIds: [] D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: OneSignal SessionManager restartSessionIfNeeded lastIds: [] D: OneSignal SessionManager sendSessionEndingWithInfluences with influences: [] D: LocationController sendAndClearPromptHandlers from non prompt flow D: registerUser:registerForPushFired:false, locationFired: true, remoteParams: null, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 D: Starting request to get Android parameters. D: OneSignalRestClient: Making request to: https://api.onesignal.com/apps/67ed8009-9d50-44c1-a8fa-c7b85071c9e2/android_params.js?player_id=19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: Adding header if-none-match: W/"e9331499f8e5567092cf6fb677d66169" V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/apps/67ed8009-9d50-44c1-a8fa-c7b85071c9e2/android_params.js?player_id=19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: GET - Using Cached response due to 304: {"awl_list":{},"android_sender_id":"500676277700","chnl_lst":[],"enterp":true,"fba":true,"outcomes":{"direct":{"enabled":true},"indirect":{"notification_attribution":{"minutes_since_displayed":60,"limit":10},"enabled":true},"unattributed":{"enabled":true}},"receive_receipts_enable":true} D: OneSignal saveInfluenceParams: InfluenceParams{indirectNotificationAttributionWindow=60, notificationLimit=10, indirectIAMAttributionWindow=1440, iamLimit=10, directEnabled=true, indirectEnabled=true, unattributedEnabled=true} I: Device unlocked: initializing all Firebase APIs for app ONESIGNAL_SDK_FCM_APP_NAME I: Device registered, push token = cH4ki0e6Rf-uxL_h1wAaMf:APA91bFkJrSGFNRYtc-1stlvbCs8ovZXKz_1ffoyfofObvm6LFul1eEvRUlwrfSvAb8BakDeZWxLxXbVWScMA2-JQs56UAgY-ZAtRb54vq25eC8cdTs04RiR-A6DqlBZmGj-lMy_mhPm D: registerUser:registerForPushFired:true, locationFired: true, remoteParams: com.onesignal.OneSignalRemoteParams$2@d77f0b, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 D: onActivityDestroyed: com.interfocusllc.patpat.core.CoreActivity@de76ed2 D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@77e4a15 D: OneSignalRestClient: Making request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: POST SEND JSON: {"app_id":"67ed8009-9d50-44c1-a8fa-c7b85071c9e2"} V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: Successfully finished request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: POST RECEIVED JSON: {"success":true,"id":"19b8f61d-64ba-480d-a496-7b2291127e09"} D: doCreateOrNewSession:response: {"success":true,"id":"19b8f61d-64ba-480d-a496-7b2291127e09"} I: Device registered, UserId = 19b8f61d-64ba-480d-a496-7b2291127e09 V: Completed request to update external user id for channel: push and success: true

I toggle on the app system push button, then open our app, onesignal log below

D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@a59657a D: GMSLocationController onFocusChange! D: OneSignal cleanOutcomes for session D: OneSignal save unattributedUniqueOutcomeEvents: [] D: OneSignal SessionManager restartSessionIfNeeded with entryAction: APP_OPEN channelTrackers: [OSChannelTracker{tag=notification_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}, OSChannelTracker{tag=iam_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}] D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: OneSignal SessionManager restartSessionIfNeeded lastIds: [] D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: OneSignal SessionManager restartSessionIfNeeded lastIds: [] D: OneSignal SessionManager sendSessionEndingWithInfluences with influences: [] D: LocationController sendAndClearPromptHandlers from non prompt flow D: registerUser:registerForPushFired:false, locationFired: true, remoteParams: null, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 D: Starting request to get Android parameters. D: OneSignalRestClient: Making request to: https://api.onesignal.com/apps/67ed8009-9d50-44c1-a8fa-c7b85071c9e2/android_params.js?player_id=19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: Adding header if-none-match: W/"e9331499f8e5567092cf6fb677d66169" I: Restoring notifications I: Querying DB for notifs to restore: created_time > 1626761900 AND dismissed = 0 AND opened = 0 AND is_summary = 0 AND expire_time > 1627366700 V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/apps/67ed8009-9d50-44c1-a8fa-c7b85071c9e2/android_params.js?player_id=19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: GET - Using Cached response due to 304: {"awl_list":{},"android_sender_id":"500676277700","chnl_lst":[],"enterp":true,"fba":true,"outcomes":{"direct":{"enabled":true},"indirect":{"notification_attribution":{"minutes_since_displayed":60,"limit":10},"enabled":true},"unattributed":{"enabled":true}},"receive_receipts_enable":true} D: OneSignal saveInfluenceParams: InfluenceParams{indirectNotificationAttributionWindow=60, notificationLimit=10, indirectIAMAttributionWindow=1440, iamLimit=10, directEnabled=true, indirectEnabled=true, unattributedEnabled=true} I: Device unlocked: initializing all Firebase APIs for app ONESIGNAL_SDK_FCM_APP_NAME I: Device registered, push token = cH4ki0e6Rf-uxL_h1wAaMf:APA91bFkJrSGFNRYtc-1stlvbCs8ovZXKz_1ffoyfofObvm6LFul1eEvRUlwrfSvAb8BakDeZWxLxXbVWScMA2-JQs56UAgY-ZAtRb54vq25eC8cdTs04RiR-A6DqlBZmGj-lMy_mhPm D: registerUser:registerForPushFired:true, locationFired: true, remoteParams: com.onesignal.OneSignalRemoteParams$2@5399815, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 D: onActivityDestroyed: com.interfocusllc.patpat.core.CoreActivity@cdd040f D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@a59657a D: OneSignalRestClient: Making request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: POST SEND JSON: {"app_id":"67ed8009-9d50-44c1-a8fa-c7b85071c9e2"} V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: Successfully finished request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: POST RECEIVED JSON: {"success":true,"id":"19b8f61d-64ba-480d-a496-7b2291127e09"} D: doCreateOrNewSession:response: {"success":true,"id":"19b8f61d-64ba-480d-a496-7b2291127e09"} I: Device registered, UserId = 19b8f61d-64ba-480d-a496-7b2291127e09 V: Completed request to update external user id for channel: push and success: true

i toggle on the app system push button, open the app, then toggle off the system push button, reopen the app, onesignal log below

D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@a59657a D: GMSLocationController onFocusChange! D: OneSignal cleanOutcomes for session D: OneSignal save unattributedUniqueOutcomeEvents: [] D: OneSignal SessionManager restartSessionIfNeeded with entryAction: APP_OPEN channelTrackers: [OSChannelTracker{tag=notification_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}, OSChannelTracker{tag=iam_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}] D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: OneSignal SessionManager restartSessionIfNeeded lastIds: [] D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: OneSignal SessionManager restartSessionIfNeeded lastIds: [] D: OneSignal SessionManager sendSessionEndingWithInfluences with influences: [] D: LocationController sendAndClearPromptHandlers from non prompt flow D: registerUser:registerForPushFired:false, locationFired: true, remoteParams: null, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 D: Starting request to get Android parameters. D: OneSignalRestClient: Making request to: https://api.onesignal.com/apps/67ed8009-9d50-44c1-a8fa-c7b85071c9e2/android_params.js?player_id=19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: Adding header if-none-match: W/"e9331499f8e5567092cf6fb677d66169" I: Restoring notifications I: Querying DB for notifs to restore: created_time > 1626761900 AND dismissed = 0 AND opened = 0 AND is_summary = 0 AND expire_time > 1627366700 V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/apps/67ed8009-9d50-44c1-a8fa-c7b85071c9e2/android_params.js?player_id=19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: GET - Using Cached response due to 304: {"awl_list":{},"android_sender_id":"500676277700","chnl_lst":[],"enterp":true,"fba":true,"outcomes":{"direct":{"enabled":true},"indirect":{"notification_attribution":{"minutes_since_displayed":60,"limit":10},"enabled":true},"unattributed":{"enabled":true}},"receive_receipts_enable":true} D: OneSignal saveInfluenceParams: InfluenceParams{indirectNotificationAttributionWindow=60, notificationLimit=10, indirectIAMAttributionWindow=1440, iamLimit=10, directEnabled=true, indirectEnabled=true, unattributedEnabled=true} I: Device unlocked: initializing all Firebase APIs for app ONESIGNAL_SDK_FCM_APP_NAME I: Device registered, push token = cH4ki0e6Rf-uxL_h1wAaMf:APA91bFkJrSGFNRYtc-1stlvbCs8ovZXKz_1ffoyfofObvm6LFul1eEvRUlwrfSvAb8BakDeZWxLxXbVWScMA2-JQs56UAgY-ZAtRb54vq25eC8cdTs04RiR-A6DqlBZmGj-lMy_mhPm D: registerUser:registerForPushFired:true, locationFired: true, remoteParams: com.onesignal.OneSignalRemoteParams$2@5399815, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 D: onActivityDestroyed: com.interfocusllc.patpat.core.CoreActivity@cdd040f D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@a59657a D: OneSignalRestClient: Making request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: POST SEND JSON: {"app_id":"67ed8009-9d50-44c1-a8fa-c7b85071c9e2"} V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: Successfully finished request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_session D: OneSignalRestClient: POST RECEIVED JSON: {"success":true,"id":"19b8f61d-64ba-480d-a496-7b2291127e09"} D: doCreateOrNewSession:response: {"success":true,"id":"19b8f61d-64ba-480d-a496-7b2291127e09"} I: Device registered, UserId = 19b8f61d-64ba-480d-a496-7b2291127e09 V: Completed request to update external user id for channel: push and success: true D: curActivity is NOW: null D: onActivityStopped: com.interfocusllc.patpat.ui.login.GuideAct@a59657a D: curActivity is NOW: null D: GMSLocationController onFocusChange! D: FocusTimeProcessorUnattributed:timeTypeApplies for influences: [SessionInfluence{influenceChannel=notification, influenceType=UNATTRIBUTED, ids=null}] true D: FocusTimeProcessorUnattributed:addTime with lastFocusTimeInfluences: [SessionInfluence{influenceChannel=notification, influenceType=UNATTRIBUTED, ids=null}] D: FocusTimeProcessorUnattributed:getUnsentActiveTime: 0 D: FocusTimeProcessorUnattributed:saveUnsentActiveTime: 82 D: FocusTimeProcessorUnattributed:getUnsentActiveTime: 82 V: scheduleSyncTask:SYNC_AFTER_BG_DELAY_MS: 30000 V: scheduleSyncServiceAsJob:atTime: 30000 I: scheduleSyncServiceAsJob:result: 1 D: FocusTimeProcessorUnattributed:getUnsentActiveTime: 82 D: FocusTimeProcessorUnattributed:getUnsentActiveTime: 82 D: FocusTimeProcessorUnattributed:sendOnFocus with totalTimeActive: 82 D: OneSignalRestClient: Making request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_focus D: OneSignalRestClient: POST SEND JSON: {"app_id":"67ed8009-9d50-44c1-a8fa-c7b85071c9e2","type":1,"state":"ping","active_time":82,"device_type":1,"net_type":0} V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_focus D: OneSignalRestClient: Successfully finished request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09/on_focus D: OneSignalRestClient: POST RECEIVED JSON: {"id":"19b8f61d-64ba-480d-a496-7b2291127e09","success":true} D: FocusTimeProcessorUnattributed:saveUnsentActiveTime: 0 D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@a59657a D: GMSLocationController onFocusChange! D: initWithCachedInAppMessages: null D: OneSignal SessionManager attemptSessionUpgrade with entryAction: APP_OPEN D: OneSignal SessionManager attemptSessionUpgrade try UNATTRIBUTED to INDIRECT upgrade D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: OneSignal ChannelTracker getLastReceivedIds lastChannelObjectReceived: [] D: Trackers after update attempt: [OSChannelTracker{tag=notification_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}, OSChannelTracker{tag=iam_id, influenceType=UNATTRIBUTED, indirectIds=null, directId='null'}] D: OneSignal SessionManager sendSessionEndingWithInfluences with influences: [] D: LocationController sendAndClearPromptHandlers from non prompt flow D: registerUser:registerForPushFired:true, locationFired: true, remoteParams: com.onesignal.OneSignalRemoteParams$2@5399815, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 I: Device registered, push token = cH4ki0e6Rf-uxL_h1wAaMf:APA91bFkJrSGFNRYtc-1stlvbCs8ovZXKz_1ffoyfofObvm6LFul1eEvRUlwrfSvAb8BakDeZWxLxXbVWScMA2-JQs56UAgY-ZAtRb54vq25eC8cdTs04RiR-A6DqlBZmGj-lMy_mhPm D: registerUser:registerForPushFired:true, locationFired: true, remoteParams: com.onesignal.OneSignalRemoteParams$2@5399815, appId: 67ed8009-9d50-44c1-a8fa-c7b85071c9e2 D: onActivityDestroyed: com.interfocusllc.patpat.core.CoreActivity@effa425 D: curActivity is NOW: com.interfocusllc.patpat.ui.login.GuideAct:com.interfocusllc.patpat.ui.login.GuideAct@a59657a D: OneSignalRestClient: Making request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: PUT SEND JSON: {"language":"zh-CN","app_id":"67ed8009-9d50-44c1-a8fa-c7b85071c9e2"} V: OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: Successfully finished request to: https://api.onesignal.com/players/19b8f61d-64ba-480d-a496-7b2291127e09 D: OneSignalRestClient: PUT RECEIVED JSON: {"success":true}

the onesignal's backend always indicate that player_id: 19b8f61d-64ba-480d-a496-7b2291127e09 subscribed.

my devices network works fine. I test this on two devices, same result.

CharlieZheng avatar Jul 28 '21 06:07 CharlieZheng

Hi @CharlieZheng,

Sorry for the delayed response and thank you for the logs. I don't see any reference to subscription status in your logs so it is hard to say what is happening.

Are you still experiencing this? If you are still experiencing this problem, we will next try to reproduce this and follow up.

Also, what 2 devices did you use for testing?

nan-li avatar Feb 08 '22 18:02 nan-li

Closing issue due to no response. Please @ mention me if we need to revisit this issue.

We have an updated major release available for our Android SDK with many improvements and enhancements! Please refer to the migration guide for more information on upgrading.

Thanks!

jennantilla avatar Jan 31 '24 00:01 jennantilla