Hi, everyone.
I am developing a push notification plugin. I want to register for remote notification and get the token. I used [[UIApplication sharedApplication] registerForRemoteNotifications] and UKismetSystemLibrary::RegisterForRemoteNotifications() function, but ApplicationRegisteredForRemoteNotificationsDelegate and ApplicationFailedToRegisterForRemoteNotificationsDelegate both aren’t triggered.
Thank you for your report. Unfortunately, I currently don’t know much about setting up Push Notifications so this is quite foreign to me. If you would like to upload some sort of reproduction project, that would be helpful. Otherwise, I’ll be trying to learn more about this tomorrow to see if I can get reproduce what you’re seeing and get a bug report in.
I’m sorry for replying you after too long time. I’m very busy recently.
This is my git project. You can try it.
You still have to make your personal apple certificate, I can not give you mine.
Oh, You have to change some project setting of iOS, like BundleIdentifier … etc.
If you can’t make this project running, please tell me as soon as. I would get you some help if I know : (.
I’ve packaged the project to an iOS device and I am seeing the same behavior, with the push notification delegates not firing (not printing messages to the log when they should). Have you tried doing this from inside the project itself rather than through a plugin to see if this may only be happening with plugins? I’d like to place a bug report in but it would be best to narrow down the affected cases first.
I tried to add RegisterForRemoteNotification to GameMode without plugin, and it still do not works. You can update my project from git, and try again.
I think the engine source code maybe is wrong.
void FIOSPlatformMisc::RegisterForRemoteNotifications()
{
#if !PLATFORM_TVOS
UIApplication* application = [UIApplication sharedApplication];
// if ([application respondsToSelector : @selector(registerUserNotifcationSettings:)])
{
#ifdef __IPHONE_8_0
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes : (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil];
[application registerUserNotificationSettings : settings];
#endif
}
else
{ // I use iPhone5s, it always come here
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
[application registerForRemoteNotificationTypes : myTypes]; // It can't run into here. So, it always don't call registerForRemoteNotificationTypes and trigger FCoreDelegates::ApplicationRegisteredForRemoteNotificationsDelegate.
#endif
}
#endif
}
I tried to call [application registerUserNotificationSettings : settings];, [application registerForRemoteNotifications]; or [application registerForRemoteNotificationTypes : myTypes];, but FCoreDelegates::ApplicationRegisteredForRemoteNotificationsDelegate isn’t triggered.
I think it obviously is a bug. Please try it again and tell me your result. I want to make sure we have same result.
I’m getting the same results but I’m not sure if this is a bug if we have no control scenario where it is working, as it may not be implemented correctly. I’ll look into this and give back to you when I find out more.
to .entitlements file, they mean turn on PushNotification of Capabilities.(I think the Capabilities of XCode is for MacOS not iOS. So I add Additional Plist Data in ProjectSetting.)
But, I can’t find where to add something to Entitlements. Do you know this? Or can you ask other people in the iOS department?