Help us understand the problem. What is going on with this article?

Xcode8(Beta2)とiOS10ではremote push通知用のdeviceTokenが取得できず失敗する時のチェック

More than 3 years have passed since last update.

ちゃんとpush通知用の設定済みでXcode7とiOS9では正常にdeviceTokenが取得できるのに
Xcode8(Beta2)とiOS10ではなぜかdeviceTokenが取れず失敗する。

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error

error => (NSError)Error Domain=NSCocoaErrorDomain Code=3000 "Appの有効な“aps-environment”エンタイトルメント文字列が見つかりません" UserInfo={NSLocalizedDescription=Appの有効な“aps-environment”エンタイトルメント文字列が見つかりません}

このような場合はTarget -> Capabilities -> Push Notificationsを確認してみる
Xcode8(Beta2)ではXcode7ではなかっかStepが追加されている
Add the Push Notifications entitlement to your entitlements file
Fix Issueボタンを押すとprojectname.entitlementsにaps-environmentを追加してくれる

 projectname.entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>aps-environment</key>
    <string>development</string>
</dict>
</plist>

これで一応開発環境でdeviceTokenが取得できる。

https://developer.apple.com/library/prerelease/content/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingLocalAndPushNotifications.html
とか見るとaps-environmentの値はdevelopmentとproductionが可能だがXcode8任せではdevelopmentのみ可能な状況

まだBeta2なので何が正解かはわからないが、とりあえず参考までに、、、

ーーーーーーーーーーーーーーーーーーーーー

一応探せたappleからの説明、、もう関係者のメアドとかもないので問い合わせもできず、、
スクリーンショット 2016-07-07 10.44.40.png

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away