Skip to content

RNMT-1298 Update OneSignal Android SDK#1

Merged
luissilvaos merged 58 commits into
outsystemsfrom
RNMT-1298
Mar 26, 2018
Merged

RNMT-1298 Update OneSignal Android SDK#1
luissilvaos merged 58 commits into
outsystemsfrom
RNMT-1298

Conversation

@luissilvaos

Copy link
Copy Markdown

No description provided.

jkasten2 and others added 30 commits December 11, 2017 18:45
* Some NotificationCompat fields were marked private in the rev 27 update
* Since the new library updated didn't provide new APIs as a replacement reflection was added to keep the same logic
* Updated to Gradle 4.4
* Updated all dev gradle files to use the latest Google Play services and the Android Support libraries
  - Updated max dependency range as well for the public maven POM file
* onNotificationProcessing` will fire in two cases;
1. When the notification is first received.
2. Each time the notification needs to be restored back to the shade.
   2a. If you prevented the notification from displaying this event should not fire.
   2b. Restoring happens when your app is updated, device is rebooted, or the app is cold started.

This fixed a case 2a. where if the notification was displayed once omitting was not preventing future restores.
* Using delayed restore instead of starting service right away
* Compatibility with OneSignal-Gradle-Plugin 0.8.0 and 0.7.0
* com.onesignal.JobIntentService$* entries would get obfuscated which would cause crashes on Oreo devices
* Resolves issue OneSignal#424
* getActiveNotifications will sometimes throw due to an Android 6.0.x bug.
  - Added a try-catch around this to prevent a crash.
* Refactored implementation.
* Resolves OneSignal#422
* Fixes error related to setInFocusDisplaying with Unity
* Moved JSON diff generation logic into a new JSONUtil class.
* Move logic from OneSignalStateSynchronizer into UserStateSynchronizer to allow specific logic for push and email user records
* UserState inner class moved into it's own java file.
* Instead of one UserState sync updates to the push and email players are broken up.
* updateDeviceInfo - push & email players
  - updates to shared fields such as tags, language, etc
* setSyncAsNewSession - push & email players
  - Flag if updates should be put on on_session or a PUT call.
* updateLocation - push & email players
  - Set the newest location point
* updatePushState - Only Push
  - Set identifier, device_type, and subscription states
* setEmail - push & email players
  - Sets email address, will create email player id
* Creates new email player id when changing email without auth hash.
* Fixed duplicated logic around is next sync a session.
* Other misc clean up
* on_focus is not called on email player id if it exists.
* Added additional tests around email scenarios.
* Broke up UserStateSynchronizer.syncUserState into parts.
* Also fixed issue where network runnables would be skipped sometimes in tests.
* Also fixed email location test
* Added a unit test for this case.
* Issue was not per-existing before this branch.
* getPermissionSubscriptionState is now part of getPermissionSubscriptionState
* Updated Unity proxy for new methods.
• Adds the Email subscription observer to the Unity proxy, so that unity developers can get email subscription updates
jkasten2 and others added 19 commits March 6, 2018 15:40
* Firebase open and received events were not firing unless there was also OneSignal handlers setup during init.
* Resolves OneSignal#454
* SyncService used to be active with the app process and relied on onTaskRemoved to persist and reschedule
* The Sync Service / Job now only actives if there are pending changes to sync on after Activity onPaused event
   - It is scheduled in the future with a delay and so if the user comes back a sync can be done without a service
* This will fix issues ANRs that are due to writing SharedPreferences
* SyncService will now longer show on ANRs unrelated to OneSignal
   - Android reports active services even if they are not the cause or even executing on any thread
* Fixes ANRs to Marmalade, Qt, and possible others due to android:stopWithTask=false
   - Most of these C/C++ libraries try joining on something while the process shutdown that hang for an unknown reason
* SyncJobService is now used on Android Lollipop 5+ and added a network required flag
Defaulting the notification title to the app name is no longer needed on Android N+
The app name is already shown in it's own section as part of the notification itself or the group.
Resolves OneSignal#452
Fixed issues with displayNotification when receiving a notification with alert was missing from the payload;
 - Getting saved into the SQL lite DB which voids notification duplicate prevention and prints logcat errors.
 - Fixed issue with notification not displaying even if an extender was used.
Resolves OneSignal#396
* Deprecated syncHashedEmail in favor of setEmail
* Added force lower case of auth hash which is expected by the OneSignal server
* Fixes ConcurrentModificationException regression bug reintroduced in 3.8.0
  - Corrected test to mimic more realistic case to prevent another regression
* Resolves OneSignal#465
* OneSignalPrefs uses a different thread to write,
   if a read is done before the write thread finishes the read would use old value
  - This may have resulted in some vary rare race condition issues
  - Reads are now done from the pending write cache now to prevent any possible issue
  - This should improve test stability as we did not wait for writes between tests before
* OneSignalPrefs now uses a HandlerThread instead of an overkill ScheduledThreadPoolExecutor
  - This results in only using 1 thread instead of up to 10 as it was configured
  - Writes are now buffer with a short 200ms delay to prevent extra write I/O
* This lets us clean up a non-optimized code path
@luissilvaos
luissilvaos merged commit 36985bf into outsystems Mar 26, 2018
@luissilvaos
luissilvaos deleted the RNMT-1298 branch March 26, 2018 08:44
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

Successfully merging this pull request may close these issues.

7 participants