OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
496
stars
263
forks
source link
Omit misleading fatal-level log for wrappers #1468
Omit misleading fatal-level log for wrappers that always happens and is alarming, and is regularly reported by SDK users.
Details
Log Fatal log for null app ID only on native SDK
Wrapper SDKs will automatically initialize with null app ID.
On wrappers, this fatal log is very misleading, so only log if this happens on the native SDK.
Most wrappers also have type signatures indicating app ID should be non-null for the public initialize API
Note all wrappers except Flutter set the wrapper sdkType before initializing with null app ID. Requires Flutter update.
Remove setLaunchOptions from OneSignal header
This was added to the OneSignalFramework header file to expose to wrappers.
However, wrappers do not actually use this because they must initialize the SDK (not sufficient to only set launch options) so cold start click listeners can be triggered.
Remove from header so it is not misleading, which suggests wrappers behave differently than how they are.
Motivation
Wrapper SDK users regularly report the alarming FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization, and it is misleading, and hides the real issue they have, if any.
Scope
An error log
Testing
Unit testing
Manual testing
Iphone 13 on iOS 17.5.1
Tested setting and not setting a OneSignalWrapper.sdkType before calling init with null app ID and seeing logs
Affected code checklist
[ ] Notifications
[ ] Display
[ ] Open
[ ] Push Processing
[ ] Confirm Deliveries
[ ] Outcomes
[ ] Sessions
[ ] In-App Messaging
[ ] REST API requests
[ ] Public API changes
Checklist
Overview
[x] I have filled out all REQUIRED sections above
[x] PR does one thing
[ x Any Public API changes are explained in the PR details and conform to existing APIs
Testing
[x] I have included test coverage for these changes, or explained why they are not needed
[x] All automated tests pass, or I explained why that is not possible
[x] I have personally tested this on my device, or explained why that is not possible
Final pass
[x] Code is as readable as possible.
[x] I have reviewed this PR myself, ensuring it meets each checklist item
Description
One Line Summary
Omit misleading fatal-level log for wrappers that always happens and is alarming, and is regularly reported by SDK users.
Details
Log Fatal log for null app ID only on native SDK
Remove
setLaunchOptions
from OneSignal headerMotivation
Wrapper SDK users regularly report the alarming
FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization
, and it is misleading, and hides the real issue they have, if any.Scope
An error log
Testing
Unit testing
Manual testing
Iphone 13 on iOS 17.5.1
OneSignalWrapper.sdkType
before calling init with null app ID and seeing logsAffected code checklist
Checklist
Overview
Testing
Final pass
This change is