You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update example app `AndroidManifest.xml` to point to new ADM bridges.
* Update PushRegistratorADM to not launch a new task and run in calling thread.
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/registration/impl/PushRegistratorADM.kt
Logging.debug("ADM Already registered with ID:$registrationId")
29
-
result =IPushRegistrator.RegisterResult(
21
+
22
+
val adm =ADM(_applicationService.appContext)
23
+
var registrationId = adm.registrationId
24
+
if (registrationId !=null) {
25
+
Logging.debug("ADM Already registered with ID:$registrationId")
26
+
result =IPushRegistrator.RegisterResult(
27
+
registrationId,
28
+
SubscriptionStatus.SUBSCRIBED
29
+
)
30
+
} else {
31
+
adm.startRegister()
32
+
33
+
// wait up to 30 seconds for someone to call `fireCallback` with the registration id.
34
+
// if it comes before we will continue immediately.
35
+
withTimeout(30000) {
36
+
registrationId =_waiter?.waitForWake()
37
+
}
38
+
39
+
result =if (registrationId !=null) {
40
+
Logging.error("ADM registered with ID:$registrationId")
41
+
IPushRegistrator.RegisterResult(
30
42
registrationId,
31
43
SubscriptionStatus.SUBSCRIBED
32
44
)
33
45
} else {
34
-
adm.startRegister()
35
-
36
-
// wait up to 30 seconds for someone to call `fireCallback` with the registration id.
37
-
// if it comes before we will continue immediately.
38
-
withTimeout(30000) {
39
-
registrationId =_waiter?.waitForWake()
40
-
}
41
-
42
-
result =if (registrationId !=null) {
43
-
Logging.error("ADM registered with ID:$registrationId")
44
-
IPushRegistrator.RegisterResult(
45
-
registrationId,
46
-
SubscriptionStatus.SUBSCRIBED
47
-
)
48
-
} else {
49
-
Logging.error("com.onesignal.ADMMessageHandler timed out, please check that your have the receiver, service, and your package name matches(NOTE: Case Sensitive) per the OneSignal instructions.")
50
-
IPushRegistrator.RegisterResult(
51
-
null,
52
-
SubscriptionStatus.ERROR
53
-
)
54
-
}
46
+
Logging.error("com.onesignal.ADMMessageHandler timed out, please check that your have the receiver, service, and your package name matches(NOTE: Case Sensitive) per the OneSignal instructions.")
0 commit comments