exponea / exponea-ios-sdk

MIT License
19 stars 27 forks source link

Tapping a push notification with deeplink triggers deeplink multiple times #8

Closed jackjpark closed 3 years ago

jackjpark commented 4 years ago

I am sending a deeplink to my app via exponeas push notifications, when tapped once, the app will open and handle the link, however it will execute the delegate method several times, leading to a view being presented 3-4 times rather than once.

Executing this code via tapping the deeplink from the notes app rather than an exponea push will execute only once as expected, therefore we propose that perhaps exponea SDK is calling actions more than once when it receives push notifications

Igi4 commented 4 years ago

Hi @jackjpark, we'll take a closer look and find out where the problem could be. Thank you for letting us know, I hope we'll be wiser by Tuesday or Wednesday :)

jackjpark commented 4 years ago

@Igi4 Hi, any updates on this?

Igi4 commented 4 years ago

@jackjpark Hi, we tried to reproduce it but we were unlucky so far. Could you please provide more information about your particular setup?

Is it happening all the time or spontaneously?

We are taking a more thorough look this week so any additional information might help.

jackjpark commented 4 years ago

Hi,

So its the PushNotificationManagerDelegate class, method pushNotificationOpened. It happens every time across all devices tested

This method is called multiple times when a user taps a push notification which contains a deeplink, leading to the code we wrote inside this delegate method being run multiple times and causing multiple navigations on top of each other, i suppose it could be an issue in the handlePushOpened function that calls this delegate method?

Im uncertain why your SDK calls this method several times but it would seem to not be possible for it to be related to our code as its an interception from the Exponea SDK when opening the push and then its own delegate method call thats repeating?

Igi4 commented 4 years ago

@jackjpark We have some new information. The Exponea SDK hooks the delegate method with swizzling to automatically call the delegate without any additional setup. It seems that this mechanism requires a little bit more tinkering to make it work correctly.

Do you have any other SDKs integrated in the app? The most probable cause is that there are multiple SDKs using this same approach and the delegate in the Exponea's SDK ends up being registred more than once. If you have more SDKs in the app, could you please try intitalizing the Exponea SDK as the last one? It might help to temporarily fix it until we update the SDK.

jackjpark commented 4 years ago

Hi @Igi4 we are using Zendesk Chat SDK, Mixpanel, Firebase and Appsflyer. I have moved Exponea to init last as recommended but would appreciate an ETA on a fix as this is quite detrimental to our production use of the SDK and our end users experience

Igi4 commented 4 years ago

@jackjpark Hey, sure. We have the fix almost ready and it will be part of the next release (2.5.0) which is scheduled to be released on Nov 25 if everything goes well.

Has moving the SDK init to the last position helped in any way?

jackjpark commented 4 years ago

Hi

We are yet to release the change to see its result with our users, Thanks for the deadline on the fix as we can work this into our next release

Jack

On 12 Nov 2019, at 16:36, Igor Liška notifications@github.com wrote:

@jackjpark https://github.com/jackjpark Hey, sure. We have the fix almost ready and it will be part of the next release (2.5.0) which is scheduled to be released on Nov 25 if everything goes well.

Has moving the SDK init to the last position helped in any way?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exponea/exponea-ios-sdk/issues/8?email_source=notifications&email_token=AIVYOSSIXKWZTYJDG54MFQLQTLLRJA5CNFSM4JD54HW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED23UXA#issuecomment-552974940, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIVYOSWWEWKXG6CFYZEI5GLQTLLRJANCNFSM4JD54HWQ.

Igi4 commented 4 years ago

Sure, no problem. I'll let you know as soon as the new version is deployed.

Igi4 commented 4 years ago

Hey @jackjpark , the new version is out and it shouldn't trigger the deeplink multiple times anymore. Please let me know if it helped :)