Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration bug when 'Limit Ad Tracking' is enabled on iOS 10 #18

Closed
xtiandiaz opened this issue Oct 12, 2016 · 11 comments
Closed

Registration bug when 'Limit Ad Tracking' is enabled on iOS 10 #18

xtiandiaz opened this issue Oct 12, 2016 · 11 comments

Comments

@xtiandiaz
Copy link

Hi there. We're currently experiencing a critical issue with users running iOS 10. We're receiving incorrect HWIDs (sequences of zeros) upon the registration process with Pushwoosh is complete. We knew about the issue because we store those IDs in our records.

According to the version notes, the bug has been already fixed for the SDK in version 4.1.4. We would need the Unity plugin to include those changes as soon as possible. Thanks in advance!

@shaders
Copy link
Contributor

shaders commented Oct 13, 2016

1.8.2 has been published with the new SDk's. Please let me know if it works for you?

@xtiandiaz
Copy link
Author

Hi, thanks for the update. There seems to be more about the issue though. I updated the plugin and run the same the exact same build in two different devices: 1. iOS 10.0.2 (iPhone 6S - "Limit Ad Tracking" enabled), and 2. iOS 9.3.1 (iPhone 5).

For the former, the registration process seems to go well once (according to XCode debug log), but after unregistering also successfully for the first time, the registration won't happen anymore. More precisely, calling Pushwoosh.Instance.RegisterForPushNotifications();seems to have no effect whatsoever. However, for the latter device, the registration/unregistration process went well 100% of the times. Continuous attempts will eventually (even though after considerable delays sometimes) provide output and consequent server response.

I could reproduce the same problem in the latest bundled Pushwoosh demo-app. Running it in the second device gives the expected results, whereas for the former it gives nothing.

@shaders
Copy link
Contributor

shaders commented Oct 18, 2016

ba54c55 Should fix the problem. Let me know if it works for you.

@shaders shaders closed this as completed Oct 18, 2016
@xtiandiaz
Copy link
Author

Hi. Unfortunately it didn't. I wish I could provide conclusive evidence about the issue, but I'm getting zero output once reproduced. Here's what I've observed though:
(iPhone 8.1 (6S), iOS 10.0.2, 'Limit Ad tracking' enabled and disabled)

  1. App is launched for the first time, either with notification enabled or disabled in the Device settings, the process will go as expected. Getting debug log from PWRequestManager and requests responses for the remote API calls. All good!
  2. Unregistering goes as expected too.
  3. Following attempts won't produce any output. But here's the thing, I have the following subsequent lines in the code:
Debug.Log("[PushNotificator] Push registration started!");
Pushwoosh.Instance.RegisterForPushNotifications();

Upon every attempt I get the above message logged in XCode's console. After it nothing comes. Using our UI switch to enable/disable push has no effect, except for the above message been logged.
4. I go to device settings and disable push for the App.
5. Come back to the app and try the switch to enable once again and, the registration happens!
6. Unregistering goes well once more.
7. Back to step 3.

@shaders
Copy link
Contributor

shaders commented Oct 21, 2016

Could you please paste your registerDevice and unregisterDevice logs? you can remove the token but please leave everything else.

@shaders
Copy link
Contributor

shaders commented Oct 21, 2016

I can confirm the behavior, but after spending half of the day I'm still clueless why this happens.

Let me explain. Basically as soon as you call unregister function, which in iOS will call:

    [[UIApplication sharedApplication] unregisterForRemoteNotifications];

Push registration breaks and stops working completely. No matter what I do, the next registration:

    [[UIApplication sharedApplication] registerForRemoteNotifications];

does not trigger ANY system callbacks. No success, no error, nothing. The iOS just ignores this call.

I've found similar problem here:
http://stackoverflow.com/questions/37950399/registerusernotificationsettings-not-work-after-using-unregisterforremotenotific/

I would propose if you need to be able to unsubscribe users from push notifications, just create boolean Tag in Pushwoosh - "subscribed" and set it accordingly.
It looks like this is a bug in iOS since we receiving the same issues across different plugins.

Also Apple does not recommend calling this method at atll.
https://developer.apple.com/reference/uikit/uiapplication/1623093-unregisterforremotenotifications?language=objc

I hope this helps.

@xtiandiaz
Copy link
Author

@shaders Thanks for following up the issue. This represents a substantial change in the way we handle push notifications for our App. ATM, we rely in Pushwoosh registration to provide a convenient way for users to enable/disable push notifications without having the need to navigate away from the App.

The way I understand it is that if the device is registered to Pushwoosh AND notifications are enabled in the device settings, the user will receive push. So even if we internally track the registration state, not being able to explicitly unregister will require the user to always disable notifs in the device in order to prevent push. In that case, toggling the in-App switch will again prompt a message telling users that in order to actually disable push they must do in the device settings, and then redirect them out of the App again to do so.

This is what I have in mind in case there isn't a better way to go. Hopefully this issue could be worked around from within the plugin itself. I appreciate any further help in this regard.

Cheers!

@shaders
Copy link
Contributor

shaders commented Oct 28, 2016

@xtiandiaz I don't understand. Why do you need to go to app settings? Why can't you just set tag "pushes enabled"? Why do you need to go out of the app? I'm confused, please try again.

@xtiandiaz
Copy link
Author

@shaders In fact, I'm just beginning to understand: 1. what you really meant, and 2. the true value of Pushwoosh tags. Fact is we haven't used them much, until now. I'll give them a try early next week and post the outcome here for anyone else interested. Thank you!

@xtiandiaz
Copy link
Author

Finally had time to look into this issue.

The tag workaround requires the device HWID for getting tags from the server, but its value is only available upon registration. Assuming that user is registered correctly to Pushwoosh for the first time, if the App eventually crashes we lose this value, and subsequent registrations won't provide it anymore. So we can't rely on that, as far as I understand.

Just checking on the iOS SDK side, noticed some seemingly related fix in this commit Pushwoosh/pushwoosh-ios-sdk@b7e5568

If that's the case, could this be promptly integrated into the Unity plugin? Otherwise, are there other updates on this matter?
Thanks!

@viridanti
Copy link

The initial issue had been fixed. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants