после реализации FCM сообщений с помощью FCM tutorial for ios здесь кода, который я использую в appdelegate.mбез видимого интерфейса для FIRMessaging объявить метод setRemoteMessageDelegate
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max) {
UIUserNotificationType allNotificationTypes =
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
UIUserNotificationSettings *settings =
[UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
} else {
// iOS 10 or later
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
UNAuthorizationOptions authOptions =
UNAuthorizationOptionAlert
| UNAuthorizationOptionSound
| UNAuthorizationOptionBadge;
[[UNUserNotificationCenter currentNotificationCenter]
requestAuthorizationWithOptions:authOptions
completionHandler:^(BOOL granted, NSError * _Nullable error) {
}
];
// For iOS 10 display notification (sent via APNS)
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
// For iOS 10 data message (sent via FCM)
[[FIRMessaging messaging] setRemoteMessageDelegate:self]; // here the method is not defined //
#endif
}
здесь в appdelegate.h
//
// AppDelegate.h
// lechef
//
// Created by Zakaria Darwish on 9/5/16.
// Copyright © 2016 CodeBee. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "constant.h"
#include <AudioToolbox/AudioToolbox.h>
#import "MPGNotification.h"
#include <AudioToolbox/AudioToolbox.h>
#include "constant.h"
@import UserNotifications;
@import GoogleMaps;
@import GooglePlaces;
@import Firebase;
@import FirebaseInstanceID;
@import FirebaseMessaging;
@interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
и я пытаюсь найти делегата firemessaging, некоторые люди в стеке говорят, что продолжайте обновлять библиотеку, и она будет исправлена here я не мог понять, что я делаю неправильно.
Удалось ли вам это сделать? Инженеры Firebase, пожалуйста, обновите свою документацию. Мне нужно выяснить много вещей - от того, чтобы заставить операцию импорта работать, в каждую строку в AppDelegate. –