1. 程式人生 > >IOS真機執行帶有Notification Content target的時候證書報錯This application or a bundle it contains has the same bun

IOS真機執行帶有Notification Content target的時候證書報錯This application or a bundle it contains has the same bun

上兩篇文章說了本地通知的相關內容,做了測試的推送證書,執行在真機上出現如下問題:
1、第一次報如下錯誤

This application or a bundle it contains has the same bundle identifier as this application or another bundle that it contains. Bundle identifiers must be unique.

這裡寫圖片描述

原因是demo的Bundle id  與 我們新建的target的Bundle id 不能一致,他們是相互獨立的

2、修改了target的bundle id,但是出現瞭如下問題

"This app contains an app extension with an illegal bundle identifier. App extension bundle identifiers must have a prefix consisting of their containing application's bundle identifier followed by a '.'."

這是因為target的bundle id 與app的證書是有關聯的,比如你app的bundle id是
com.company.appname ,那麼你的target的bundle id 應該是com.company.appname.extensionname