-
Notifications
You must be signed in to change notification settings - Fork 11
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
chore: initialize messaging push module #178
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import Foundation | ||
|
||
class Env { | ||
static let siteId: String = "siteid" | ||
static let apiKey: String = "apikey" | ||
static let cdpApiKey: String = "cdpApiKey" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,15 @@ class CustomerIO { | |
} | ||
|
||
/// Access push messaging functionality | ||
CustomerIOMessagingPushPlatform get pushMessaging => _pushMessaging; | ||
static CustomerIOMessagingPushPlatform get pushMessaging { | ||
if (_instance == null) { | ||
throw StateError( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure we should be throwing here and crashing, probably just log maybe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same how we do for instance in feature branch. Since we need to return a non-null value, we unfortunately can't simply log and continue here. |
||
'CustomerIO SDK must be initialized before accessing push module.\n' | ||
'Call CustomerIO.initialize() first.', | ||
); | ||
} | ||
return _instance!._pushMessaging; | ||
} | ||
|
||
/// Access in-app messaging functionality | ||
CustomerIOMessagingInAppPlatform get inAppMessaging => _inAppMessaging; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it to disable push permission on app launch