pusher / push-notifications-android

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

Enforce singleton to use one instanceId #95

Closed daniellevass closed 4 years ago

daniellevass commented 4 years ago

Allowing developers to start the singleton with multiple different instanceIds would cause issues e.g. if I PushNotifications.start("id-1") and then PushNotifications.start("id-2") in two different threads at the same time - which instance id would the PushNotifications.addDeviceInterest("potato") go to? We're going to prevent people from doing this in the singleton only, if they want to use multiple device interests they must use PushNotificationInstance class.