pusher / push-notifications-android

Android SDK for Pusher Beams
https://www.pusher.com/beams
MIT License
21 stars 22 forks source link

Don't backup SharedPreferences #86

Closed maxoumime closed 4 years ago

maxoumime commented 4 years ago

Hi there,

I noticed that you don't exclude the SharedPreferences from the application auto-backup. Starting from API 23, all devices are automatically backing up shared preferences, files and databases and you need to exclude the files you don't want being backed up. Because of that, a user can receive push notification with another device's registration.

In my case, a user started receiving Push notifications on his new phone even though he never logged into my app on his new phone, because the Play Store restored the backed up version of te preferences.

You need to check out which files you need to exclude from being persisted, maybe there are more than the following shared pref

<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
    <exclude domain="sharedpref" path="com.pusher.pushnotifications.PushNotificationsInstance.xml" />
</full-backup-content>
jonathanlloyd commented 4 years ago

Hi! Thanks for the report - I've scheduled this issue for triage and we will respond to this issue when we have a fix.

daniellevass commented 4 years ago

Thanks @maxoumime for the report! We've fixed this in the latest release version 1.4.5 :-) I'm going to close this issue, but if you see this again please reach out!