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

Dev/bgy/rebase #5

Merged
merged 59 commits into from
Feb 5, 2020
Merged

Dev/bgy/rebase #5

merged 59 commits into from
Feb 5, 2020

Conversation

baptiste-nv
Copy link

No description provided.

Nightsd01 and others added 30 commits July 18, 2018 18:41
• Adds an update handler to methods that update tags to allow developers to respond when the HTTP request is finished (or fails)
• Adds a new public method oneSignalLog() to allow wrapper SDK's to use OneSignal logging
• Since users may call sendTags() multiple times, and the sendTags() requests are batched, this would have resulted in only the most recent callback/handler being called.
• Implemented an array of SendTagsHandlers to make sure that when the batched SendTags request is finished, it will execute each unique handler individually.
• The SDK was not checking to make sure that a ChangeTagsUpdateHandler reference was non-null before executing it.
• Added checks to make sure null handlers aren't invoked
• Creates a copy of the sendTagsHandlers array since it gets cleared immediately afterwards
• Since developers can manually require consent by editing the manifest, the wrapper SDK's need a way of knowing if the Android SDK is waiting on the user's privacy consent
• Exposes a public getter that returns TRUE if consent is required but hasn't been provided yet.
• Adds a testcase to make sure that the new requiresUserPrivacyConsent() method returns correct results
• Adds curly braces since the for-loops are indented. Applies the change to all loops for consistency.
Add Update Handler for Send/Delete Tags
Corrected wakeful service fallback to job call
• Adds a ChangeTagsUpdateHandler to allow for callbacks when sending/deleting tags
• Publicly exposes onesignalLog() method so that wrapper SDK's can use it.
• Adds a getter method for requiresUserPrivacyConsent
• Corrects wakeful service GCM fallback
• In rare situations, the main UI thread can block on the user state synchronization making a potentially very long running HTTP request
• The user state synchronization model of the Android SDK needs to be significantly refactored & simplified
• In the mean time, this commit makes a minor change so that the user state synchronizer never blocks/holds locks while making HTTP requests
• In the previous commit, I wanted to explicitly use a sync lock object for different methods to synchronize on, to allow more fine-grained control over what parts of methods get synchronized
• However, I mistakenly left out a method called getToSyncUserState().
• This commit removes the method synchronization and synchronizes on the syncLock, an instance property that other methods also use to synchronize on.
• We have several demo projects for Android, but the default demo project has few options
• This commit adds multiple buttons to the demo to test several different aspects of the SDK without having to open a different project or deal with modules/etc.
• Fixes a somewhat frequent ANR (more details in 3.10.1 release notes)
• It appears that in a previous commit (f614e8b) we added code to disable the FirebaseInstanceIdService if there isn't a default Firebase app
• It looks like we tried to handle the case where the FirebaseInstanceIdService class was missing, but we were only catching NoClassDefFound errors
• After some further research, it looks like we should also be catching IllegalArgumentExceptions as well since this is what the package manager instance will throw if the FirebaseInstanceIdService class is missing
* Fixes reported NPE from RestoreJobService.onHandleWork. Issue OneSignal#591
* Issue maybe related to bug in Android 6.0.1 with BaseBundle.java:127
   - This works around any possible issue here.
* If OneSignal was not initialized from onCreate of the application class on Android 7 and older.
* This was due to the appContext not being set before trying to read from shared preferences.
* All entry points now set the appContext to avoid any future issue with dependencies on this.
   - Includes OneSignal BroadcastReceivers, Services, and Activities.
* Fixes OneSignal#618
* If the Android Oreo notification channel has a Medium importance or lower
    we now correctly skip setting sound, led, and vibration settings for pre-Oreo devices.
* Refactored these setting into a new setAlertnessOptions method to group this logic.
* This allows overriding the API 26 check so when we have FCM high priority wakelock we can start a IntentService instead of using a JobService,
  - A JobService won't start when doze is active so the job would delayed otherwise.
* Implementing the flag will be in the next commit, split this out so we can see what was changed easier if we need to apply any upstream changes from Google.
* Adding a result prevents the GMS  app from putting a confusing CANCELLED entry into the logcat.
jramosMobilendo and others added 29 commits October 5, 2018 20:40
* Only the most recent 49 notifications will be restore instead of just limiting on the past week.
   - Ensures only the most recent relevant notifications are shown.
* Also increased delay between restoring each notification to 200ms.
* This fixes the following logcat messages
   - E/NotificationService: Package has already posted 50 notifications. Not showing more.  package=####
   - E/NotificationService: Package enqueue rate is 10.56985. Shedding events. package=####
* This can mitigate OneSignal#644
* This is safe as OneSignalPrefs will cache the value if the context is not set yet.
• Apps should be able to add observers (ie. addSubscriptionObserver) even if privacy consent has not yet been granted.
• Adds tests to make sure that apps can add the observers even if privacy consent hasn't been granted
• The tests verify that the observers fire correctly once consent is granted.
Remove Privacy Consent Requirement to Add Observers
* This handles the IllegalArgumentException which can throw on Oreo+
  when a high priority notification is sent and when a NotificationExtenderService is setup.
  - Only thrown in the case where FCM could not add the app to the whitelist.
* Added boot permission check to setPersisted(true) which could throw on some devices.
* Lowered parcel size from package manager which means less chance of requesting over the limit.
* Package manager may have already die so it won't fix these cases.
• Adds public methods setExternalUserId() and removeExternalUserId() that let developers map their own userID's in our system
• TODO: Add tests to ensure the methods generate correct API requests and that it uses the on_session request if it hasn't already occurred
• Adds tests to make sure that setExternalUserId requests are correctly formatted and will wait for registration request if needed
• Fixes the setExternalUserId() request to use a PUT HTTP request if registration has already occurred
• It turns out the Android SDK already has a state synchronizer that can persist previously set player values and will not send duplicate requests if the value is unchanged.
• This commit switches to utilizing then state synchronizer
• Adds a new test to make sure that the external ID is not sent if setExternalUserId() is called but the ID is the same as the previous session/s
• Adds a test to verify that the externalUserId is set on both Email and Push player accounts
* ACTION_BOOT_COMPLETED is invalid, BOOT_COMPLETED is the correct intent action
• Includes miscellaneous bug fixes and improvements
• Adds the set & remove external ID methods to the unity proxy
* Wont't be commonly used, however it is valid if you need to call provideUserConsent before OneSignal.init
…s handlers instead of only retaining a reference to the most recent handler.

• So in the past, if getTags() was called multiple times, only the handler for the most recent call would get executed.
• Makes a small change to the example project to fix a crash when GDPR consent was not granted
• Adds a test to ensure that multiple handlers for getTags() are retained and executed independently
* Also omit trying to restore notifications if notifications are disabled.
* Misc code cleanup around this
* Badge count is now always set to based on the notifications in the shade, regardless if they are from OneSignal or not
* Fixing issue where new notifications would not show if there are already 49 notifications in the shade
   - Now handles removing oldest notifications to make room for new ones.
* Clearing notifications now works even if the privacy was not accepted.
* Fixed issue where badges did not clear if clear notifications was called before init.
* Badge counts are now updated after restoring notifications.
@baptiste-nv baptiste-nv merged commit 49bdd78 into master Feb 5, 2020
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.

6 participants