File tree Expand file tree Collapse file tree 2 files changed +33
-11
lines changed
OneSignalSDK/onesignal/core/src/main/java/com/onesignal/core/internal/startup Expand file tree Collapse file tree 2 files changed +33
-11
lines changed Original file line number Diff line number Diff line change
1
+ package com.onesignal.core.internal.startup
2
+
3
+ import com.onesignal.OneSignal
4
+ import com.onesignal.core.internal.application.IApplicationService
5
+ import com.onesignal.core.internal.config.ConfigModel
6
+ import com.onesignal.core.internal.config.ConfigModelStore
7
+
8
+ /* *
9
+ * Implement and provide this interface as part of service registration to indicate the service
10
+ * wants to be instantiated and its [bootstrap] function called during the initialization process.
11
+ *
12
+ * When [IBootstrapService.bootstrap] is called, only [OneSignal.setAppId] have been called during
13
+ * [OneSignal.initWithContext].
14
+ *
15
+ * This means the following is true:
16
+ *
17
+ * 1) An appContext is available in [IApplicationService.appContext].
18
+ * 2) An appId is available in [ConfigModel.appId] via [ConfigModelStore.get]
19
+ * 3) None of the [IStartableService.start] is called
20
+ *
21
+ * When bootstrap there is no guarantee that any other data is available. Typically a bootstrap service
22
+ * must be instantiated immediately and will add their appropriate hooks to then respond to changes
23
+ * in the system.
24
+ */
25
+ interface IBootstrapService {
26
+ /* *
27
+ * Called when the service is to be bootstrap. The appId and appContext have already been established.
28
+ */
29
+
30
+ fun bootstrap ()
31
+ }
Original file line number Diff line number Diff line change @@ -15,9 +15,8 @@ import com.onesignal.core.internal.config.ConfigModelStore
15
15
* 1) An appContext is available in [IApplicationService.appContext].
16
16
* 2) An appId is available in [ConfigModel.appId] via [ConfigModelStore.get]
17
17
*
18
- * When started there is no guarantee that any other data is available. Typically a startable service
19
- * must be instantiated immediately and will add their appropriate hooks to then respond to changes
20
- * in the system.
18
+ * When started there is no guarantee that any other data is available. Typically a startable service
19
+ * can asynchronously start some lengthy process that doesn't require immediate use.
21
20
*/
22
21
interface IStartableService {
23
22
/* *
@@ -26,11 +25,3 @@ interface IStartableService {
26
25
*/
27
26
fun start ()
28
27
}
29
-
30
- internal interface IBootstrapService {
31
- /* *
32
- * Called when the service is to be started. The appId and appContext have already been
33
- * established.
34
- */
35
- fun bootstrap ()
36
- }
You can’t perform that action at this time.
0 commit comments