0
私はiOSアプリで都市飛行船を使用しており、プッシュ通知のバックエンドでも使用しています。最近では、Firebase Cloudメッセージングを使用するディジットからfirebaseへの電話番号認証を移行する必要がありました。私が都市飛行船の設定をコメントアウトするまでFirebase Cloudのメッセージは機能しません。両方を使用する方法はありますか?問題の原因は何ですか?この移行のために現在のプッシュ通知設定を変更したくありません。iOSで都会の飛行船とFacebookのクラウドメッセージングを一緒に使用できない
私AppDelegateは現在、次のようになります。
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UIBarButtonItem.appearance()
.setTitleTextAttributes([NSFontAttributeName : UIUtils.getFont(14)],
for: UIControlState())
FirebaseApp.configure()
// setupUrbanAirship()
return true
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// Pass device token to auth
Auth.auth().setAPNSToken(deviceToken, type: AuthAPNSTokenType.sandbox)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
Auth.auth().canHandleNotification(userInfo)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
if Auth.auth().canHandleNotification(userInfo) {
completionHandler(.noData)
return
}
}
fileprivate func setupUrbanAirship() {
let filename = PropertyUtils.getUAPropertyFileName()
let path = Bundle.main.path(forResource: filename, ofType: "plist")
let config = UAConfig(contentsOfFile: path!)
//config.automaticSetupEnabled = false
UAirship.takeOff(config)
let channelID = UAirship.push().channelID
print("My Application Channel ID: \(channelID)")
UAirship.push().userPushNotificationsEnabled = true
}