Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Cordova-推送通知firebase不在状态栏中,但在android中工作_Ios_Objective C_Cordova_Firebase_Apple Push Notifications - Fatal编程技术网

Ios Cordova-推送通知firebase不在状态栏中,但在android中工作

Ios Cordova-推送通知firebase不在状态栏中,但在android中工作,ios,objective-c,cordova,firebase,apple-push-notifications,Ios,Objective C,Cordova,Firebase,Apple Push Notifications,我正在将firebase添加到我的cordova项目中。我对推送通知有问题,通知在运行时会打印到控制台中。但不来通知栏 你知道这件事吗我是否需要添加任何其他委托方法.. 我正在连接日志->FCM,当应用程序进入后台日志-> FCM断开 -(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项 { CGRect屏幕边界=[[UIScreen mainScreen]边界]; self.window=[[UIWindow alloc]in

我正在将firebase添加到我的cordova项目中。我对推送通知有问题,通知在运行时会打印到控制台中。但不来通知栏

你知道这件事吗我是否需要添加任何其他委托方法..

我正在连接日志->FCM,当应用程序进入后台日志-> FCM断开

-(BOOL)应用程序:(UIApplication*)应用程序使用选项完成启动:(NSDictionary*)启动选项
{
CGRect屏幕边界=[[UIScreen mainScreen]边界];
self.window=[[UIWindow alloc]initWithFrame:screenBounds];
self.window.autoresizesSubviews=是;
//仅当尚未在子类中设置时设置
如果(self.viewController==nil){
self.viewController=[[CDVViewController alloc]init];
}
//通过在config.xml中设置标记来设置应用程序的起始页。
//如有必要,取消注释下面的行以覆盖它。
//self.viewController.startPage=@“index.html”;
//注意:要自定义视图的帧大小(默认为全屏),请覆盖
//[self.viewController视图将出现在视图控制器中:]。
self.window.rootViewController=self.viewController;
[self.window makeKeyAndVisible];
//[self-saveDeviceTokenAPI:@“83a86eb457edd131a2ace741e1214d988482dd3618f8858e1dba736e1900c733”;
if([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
NSLog(@“我的令牌是……”);
//iOS 8通知
[应用程序注册表通知设置:[UIUserNotificationSettings设置类型:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)类别:无];
[申请登记处证明];
}
其他的
{
NSLog(@“我的令牌是:”);
//iOS<8通知
[应用程序注册信息类型:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
}
返回YES;
}
#pragma标记:-推送从这里开始
#pragma标记-推送通知委托方法
-(无效)应用程序:(UIApplication*)应用程序DIdRegisterForRemotionTificationswithDeviceToken:(NSData*)deviceToken
{
NSLog(@“我的令牌是:%@”,deviceToken);
NSString*deviceToken安装=[[[deviceToken说明]
StringByReplacingOfString:@“with String:@”]
StringByReplacingOfString:@“和字符串:@]”发生;
NSLog(@“生成的设备令牌字符串为:%@”,deviceTokenString);
//[自救设备Tokenapi:deviceTokenString];
[[NSUserDefaults standardUserDefaults]设置对象:deviceTokenString forKey:@“deviceToken”];
NSLog(@“从用户定义生成的设备令牌:%@,[[NSUserDefaults standardUserDefaults]objectForKey:@“deviceToken”);
}
-(无效)应用程序:(UIApplication*)应用程序未能注册远程通知,错误为:(N错误*)错误
{
NSLog(@“无法获取令牌,错误:%@”,错误);
}
#此处为Push End的pragma标记
//这发生在我们运行时(在后台,或从我们自己的应用程序中)
//仅当40x-Info.plist指定要处理的协议时有效
-(BOOL)应用程序:(UIApplication*)应用程序openURL:(NSURL*)url源应用程序:(NSString*)源应用程序注释:(id)注释
{
如果(!url){
返回否;
}
//所有插件都将收到通知,并调用它们的处理程序
[[NSNotificationCenter defaultCenter]postNotification:[NSNotificationNotificationWithName:CDVPluginHandleOpenURLNotification对象:url]];
返回YES;
}
#如果IPHONE操作系统版本最大允许值<90000
-(NSInteger)应用程序:(UIApplication*)应用程序支持的Interface Orientions for window:(UIWindow*)窗口
#否则
-(UIInterfaceOrientationTask)应用程序:(UIApplication*)应用程序支持InterfaceOrientationsforWindow:(UIWindow*)窗口的接口方向
#恩迪夫
{
//默认情况下,iPhone不支持倒置,而iPad支持。覆盖以始终允许所有方向,并让根视图控制器决定允许的方向(支持的方向掩码相交)。
NSUInteger supportedInterfaceOrientations=(1尝试此函数:

- (void)launchRemoteNotificationInForegroundWithUserInfo:(NSDictionary *)userInfo {
    UILocalNotification *notification = [[UILocalNotification alloc] init];
    notification.fireDate = [NSDate date];
    notification.timeZone = [NSTimeZone localTimeZone];
    notification.repeatInterval = 0;
    notification.alertTitle = userInfo[@"aps"][@"alert"][@"body"];
    notification.alertBody = userInfo[@"aps"][@"alert"][@"title"];
    notification.applicationIconBadgeNumber = 1;
    notification.soundName = UILocalNotificationDefaultSoundName;
    [[UIApplication sharedApplication] scheduleLocalNotification:notification];
    [[UIApplication sharedApplication] presentLocalNotificationNow:notification];

    UIAlertView *alertView = [[UIAlertView alloc]
                              initWithTitle:userInfo[@"aps"][@"alert"][@"title"]
                              message:userInfo[@"aps"][@"alert"][@"body"]
                              delegate:self
                              cancelButtonTitle:@"OK"
                              otherButtonTitles:nil];

    [alertView show];
}
叫它进来

didReceiveRemoteNotification:
didReceiveRemoteNotification: