Programing

앱 스토어의 애플리케이션에 유효한 'aps-environment'자격 문자열이 없습니다.

crosscheck 2020. 9. 20. 08:47
반응형

앱 스토어의 애플리케이션에 유효한 'aps-environment'자격 문자열이 없습니다.


그래서 저는 약 한 달 전에 발표 한 Dripper라는 앱이 있고 며칠 전에 업데이트되었습니다. 업데이트는 푸시 알림과 약간의 조정을 추가했습니다. 개발 프로필을 사용하여 sandbox-apn으로 테스트했으며 모든 것이 잘 작동했습니다. 그런 다음 프로덕션 APN으로 전환하고 테스트 비행으로 푸시했는데 다시 완벽하게 작동했습니다. 시장에 업데이트를 게시하고 실행 한 후 서버에서 새로운 푸시 등록을받지 못하는 것을 알았습니다. 장치의 콘솔 로그를 살펴본 결과 다음을 발견했습니다.

12 월 4 일 17:55:15 Ina-touch-it coffco [1210] : 원격 알림 등록
12 월 4 일 17:55:15 Ina-touch-it SpringBoard [52] : 애플리케이션에 유효한 'aps-environment'자격 문자열이 없습니다. 'Dripper': (null). 알림이 전달되지 않습니다.
12 월 4 일 17:55:15 Ina-touch-it coffco [1210]<Warning>: Failed to register with error : Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x174270900 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}

프로덕션 APN이 애드혹 빌드와 앱 스토어 빌드간에 동일하게 작동 할 것이라고 생각했기 때문에 약간 혼란 스럽습니다.

내 앱 ID와 권한-> http://i.stack.imgur.com/uf4pB.png

다음은 앱 스토어의 프로비저닝 프로파일입니다-> http://i.stack.imgur.com/AYOV5.png


푸시 알림 기능을 활성화하여이 문제를 해결합니다.

.xcodeproj-> 기능-> 푸시 알림 활성화를 클릭하십시오.


이 문제를 다음과 같이 수정했습니다.

  • Xcode "기본 설정"으로 이동
  • "계정"탭으로 이동
  • 내 Apple ID를 선택하고 "세부 정보보기"를 클릭합니다.
  • 새로 고침하려면 왼쪽 하단의 화살표를 클릭하세요.
  • "완료"를 클릭하십시오.

그리고 다시 시도하십시오!

출처:


Target—> 기능 —> 푸시 알림을 활성화해야합니다. Xcode 8을 사용하여이 문제에 직면했습니다.여기에 이미지 설명 입력


이러한 문제는 현재 프로비저닝 프로파일에 APNS 정보가 포함되어 있지 않기 때문입니다. 프로비저닝 프로파일은 APNS 인증서를 생성하기 전에 생성되기 때문입니다.

따라서 문제를 해결하려면 새 프로비저닝 프로파일을 생성하고 Xcode에서 프로비저닝 프로파일을 선택하십시오. 그러면 완료됩니다.

또한 푸시를 추가하면 키 체인의 인증서도 업데이트 한 것 같습니다.


iOS 8.0 이상 버전을 사용하여 동일한 문제가 발생했습니다. 장치 토큰을받지 못했고 "응용 프로그램에 유효한 'aps-environment'자격 문자열이 없습니다."라는 오류 메시지가 표시되었습니다.

아래 단계를 사용하여 수정했습니다.

  • 앱 ID에 대한 새 프로비저닝 프로필을 만들었습니다.
  • xcode에 추가
  • 프로젝트 Xcode "기본 설정"으로 이동
  • "계정"탭으로 이동하여 내 Apple ID를 선택하고 "세부 정보보기"를 클릭합니다.
  • 프로비저닝 프로필 선택
  • 새로 고침하려면 왼쪽 하단의 화살표를 클릭하세요.
  • "완료"를 클릭하십시오.

이제 프로젝트를 실행하면 제대로 작동합니다.


Xcode 9와 관련하여 일부 답변은이 특정 문제를 해결하기 위해 오래되었거나 불완전합니다.

나를 위해 따라야 할 단계는 다음과 같습니다.

1. 프로비저닝 프로필 생성

( FCM은 푸시 알림 의 전제 조건 은 아니지만 가이드는 놀랍도록 명확합니다. 여기에 링크가 있습니다. )

개발 중에 앱을 테스트하려면 아직 App Store에 게시되지 않은 앱을 실행하도록 장치에 권한을 부여하는 개발 용 프로비저닝 프로파일이 필요합니다.

  1. Apple Developer Member Center로 이동하여 로그인합니다.
  2. 인증서, 식별자 및 프로필로 이동합니다.
  3. 왼쪽 상단의 드롭 다운 메뉴에서 iOS, tvOS, watchOS가 아직 선택되지 않은 경우 선택하고 프로비저닝 프로파일> 모두로 이동합니다.
  4. + 버튼을 클릭하여 새 프로비저닝 프로필을 만듭니다.
  5. 프로비저닝 프로파일 유형으로 iOS 앱 개발을 선택한 다음 계속을 클릭하십시오.
  6. 드롭 다운 메뉴에서 사용하려는 앱 ID를 선택한 다음 계속을 클릭합니다.
  7. Select the iOS Development certificate of the App ID you have chosen in the previous step, then click Continue.
  8. Select the iOS devices that you want to include in the Provisioning Profile, then click Continue. Make sure to select all the devices you want to use for your testing.
  9. Input a name for this provisioning profile (e.g. Firebase Sample App Development Profile), then click Generate.
  10. Click Download to save the Provisioning Profile to your Mac.
  11. Double-click the Provisioning Profile file to install it.

2. Activate Push Notification capabilities

  1. Go to project editor, from official manual 여기에 이미지 설명 입력
  2. In capabilities section, Activate Push Notification 여기에 이미지 설명 입력

For some reason Wei's solution was not working for me. When clicking the Fix entitlements, Xcode generated two files and it still did not function, indeed the generated entitlements files were empty.

This was caused (apparently) by the PRODUCT_NAME of the project being rather long and including spaces and "ä" and "ö" letters. After changing it to a short version with english-only letters the fix by Wei worked correctly.


It took me a while to figure out what causing no valid aps-environment entitlement error. The problem was that there were two .entitlements files in XCode project. One is platform/ios//.entitlements and another one is platform/ios//Resources/.entitlements and the appropriate entitlements is present in the former file only while XCode is configured to use the latter. I updated the latter file manually and everything started to work. Another option to fix this is to change which .entitlements is used by XCode. This can be done in Build Settings --> Signing --> Code Signing Entitlements config param.

I'm not sure why there are two .entitlements files in XCode. Could it be that the cordova push plugin created the second one (i'm developing a hybrid cordova mobile app)? And what is the correct location for the .entitlements file?


이 문제를 경험하고 첫 번째 해결책으로 해결했습니다.

그러나 두 개의 애플 계정이 로그인되어있어 한 번 실패했습니다. 하나를 제거한 후 모든 것이 작동했습니다.

참고 URL : https://stackoverflow.com/questions/27324020/no-valid-aps-environment-entitlement-string-found-for-application-on-app-store

반응형