-
Notifications
You must be signed in to change notification settings - Fork 23
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
refactor: push modules initialization #418
Conversation
….com:customerio/customerio-ios into shahroz/native-digraph
…erio-ios into shahroz/datapipeline-module
…io-ios into shahroz/datapipeline-module
…io-ios into shahroz/data-pipeline-usage
…ustomerio-ios into rehan/cdp-feature-modules
Co-authored-by: Levi Bostian <[email protected]>
…ustomerio-ios into rehan/cdp-feature-modules
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
@@ -7,10 +7,10 @@ import Foundation | |||
*/ | |||
public class MessagingPush: ModuleTopLevelObject<MessagingPushInstance>, MessagingPushInstance { | |||
@Atomic public private(set) static var shared = MessagingPush() | |||
@Atomic public private(set) static var moduleConfig: MessagingPushConfigOptions = MessagingPushConfigOptions.Factory.create() |
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.
Since we've already implemented this in the upcoming changes for improving push metrics, I've reused the same to avoid introducing another option for the same functionality.
guard getImplementationInstance() == nil else { | ||
logger.info("\(moduleName) module is already initialized. Ignoring redundant initialization request.") | ||
return |
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.
Based on our ongoing slack discussion
logger.info("\(moduleName) module successfully set up with SDK") | ||
} | ||
|
||
override public func createImplementationInstance() -> MessagingPushInstance? { | ||
MessagingPush.initialize() | ||
} |
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.
To disable auto initialization for MessagingPush
|
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.
With independent module initialization, I think we no longer need this
helps: https://github.com/customerio/issues/issues/11650
Changes
AppDelegate
fix forMessagingInApp
MessagingPush
to initialize only onceconfigure
option fromMessagingPush
MessagingPushAPN
andMessagingPushFCM
initialization methods