开发的插件,能够正常接收推送,但是推送的消息打开不能进入到指定的方法
-
application:(UIApplication _Nullable)application didReceiveRemoteNotification:(NSDictionary _Nullable)userInfo
-
(void)application:(UIApplication _Nullable)application didReceiveRemoteNotification:(NSDictionary _Nullable)userInfo fetchCompletionHandler:(void (^_Nullable)(UIBackgroundFetchResult))completionHandler
-
(void)application:(UIApplication _Nullable)application didReceiveLocalNotification:(UILocalNotification _Nullable)notification
@interface HookPluginProxy : NSObject <UniPluginProtocol>
@end
@implementation HookPluginProxy
- (void)onCreateUniPlugin {
NSLog(@"UniPluginProtocol Func: %@,%s",self,__func__);
}
- (BOOL)application:(UIApplication *_Nullable)application didFinishLaunchingWithOptions:(NSDictionary *_Nullable)launchOptions {
NSLog(@"UniPluginProtocol Func didFinishLaunchingWithOptions: %@,%s",self,__func__);
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *_Nullable)application {
NSLog(@"UniPluginProtocol Func: %@,%s",self,__func__);
}
- (void)applicationDidEnterBackground:(UIApplication *_Nullable)application {
NSLog(@"UniPluginProtocol Func: %@,%s",self,__func__);
}
- (void)application:(UIApplication *_Nullable)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *_Nullable)deviceToken
{
NSLog(@"%@",deviceToken);
}
- (void)application:(UIApplication *_Nullable)application didReceiveRemoteNotification:(NSDictionary *_Nullable)userInfo
{
NSLog(@"didReceiveRemoteNotification:%@",userInfo);
}
- (void)application:(UIApplication *_Nullable)application didReceiveRemoteNotification:(NSDictionary *_Nullable)userInfo fetchCompletionHandler:(void (^_Nullable)(UIBackgroundFetchResult))completionHandler
{
NSLog(@"didReceiveRemoteNotification:fetchCompletionHandler:%@",userInfo);
}
- (void)application:(UIApplication *_Nullable)application didReceiveLocalNotification:(UILocalNotification *_Nullable)notification
{
NSLog(@"didReceiveLocalNotification");
}
3 个回复
l***@enjoyauto.com (作者)
问题已经找到了
c***@126.com
同样问题,请问怎么解决的?
l***@enjoyauto.com (作者)
把生成的库在导入到你的测试项目中,否则不执行
2020-08-12 10:34
fcbflying
你的问题都解决了吗?
我的插件开发出来后,在hbuilder中集成后。
didRegisterForRemoteNotificationsWithDeviceToken 这个方法没有调用。
didFinishLaunchingWithOptions这个方法是调用了的。
不知道什么原因呢?
你的qq多少呢,咨询一下呢,多谢!
1***@163.com
你好 请问你的问题解决了吗?我遇到了同样的问题
2020-11-26 10:09
fcbflying
回复 1***@163.com: 解决了,还要继承 UNUserNotificationCenterDelegate 这个
2020-11-26 13:41