Xamarin iOSアプリケーションのプッシュ通知を設定するだけです。私は、必要な権限を持つプロビジョニングプロファイルを使用していることを確認しました(iOS開発者ポータルでプッシュ通知を有効にする)。私は私のアプリで上記のプロファイルを使用していることを確認しました。RemoteNotificationsメソッドがヒットしない
if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
{
var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(
UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound,
new NSSet());
UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
UIApplication.SharedApplication.RegisterForRemoteNotifications();
}
else
{
UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
}
私は成功し、彼らがプッシュ通知を許可する場合、ユーザーに尋ねるプロンプトを見ることができます:私AppDelegateで、FinishedLaunching方法では、私は、次のコードを実行しています。ここでの問題は、私はAllow
をタップしたときに、ある以下のオーバーライドメソッドのどちらも打撃を受ける:
RegisteredForRemoteNotifications
FailedToRegisterForRemoteNotifications
を私も自分のiOSプロジェクト設定で、私もEnable BackgroundModes
チェックしたことを、確認しましたRemoteNotifications
がチェックされています。
誰もがこれに関する問題を抱えていましたか?あれば、どのように解決しましたか?
万が一シミュレータでテストしていますか?シミュレータ上では暗黙のうちに失敗しますが、実際にはサポートされていないので、少なくともエラーを投げるべきですが、誰が私に教えてください。 – nullpotent
良い質問ですが、いいえ。私は自分のデバイスを使用しています。 – jdmdevdotnet
あなたはios 10ですか?いくつか[変更](https://blog.xamarin.com/getting-started-with-the-ios-10-notification-framework/) – nullpotent