Skip to content
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

Call to the registerForRemoteNotifications #1293

Merged
merged 10 commits into from
Apr 15, 2022
10 changes: 10 additions & 0 deletions Source/ARTPush.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,22 @@ + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error rest:(
}

- (void)activate {
#if TARGET_OS_IOS && !TARGET_OS_SIMULATOR
dispatch_async(dispatch_get_main_queue(), ^{
lukasz-szyszkowski marked this conversation as resolved.
Show resolved Hide resolved
[[UIApplication sharedApplication] registerForRemoteNotifications];
});
#endif
[self getActivationMachine:^(ARTPushActivationStateMachine *stateMachine) {
[stateMachine sendEvent:[ARTPushActivationEventCalledActivate new]];
}];
}

- (void)deactivate {
#if TARGET_OS_IOS && !TARGET_OS_SIMULATOR
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] unregisterForRemoteNotifications];
lawrence-forooghian marked this conversation as resolved.
Show resolved Hide resolved
});
#endif
[self getActivationMachine:^(ARTPushActivationStateMachine *stateMachine) {
[stateMachine sendEvent:[ARTPushActivationEventCalledDeactivate new]];
}];
Expand Down