Xcode 6 error: “Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.”

后端 未结 20 1367
孤独总比滥情好
孤独总比滥情好 2020-12-08 01:45

I\'m trying to build an extension project and Xcode keeps throwing the error in subject.

\"Xcode

20条回答
  •  离开以前
    2020-12-08 02:18

    The solution is already covered in a lot of answers:

    Containing App Bundle Id: com.alphabet.gmail

    and

    Extension app bundle id: com.alphabet.gmail.notificationServiceExtension

    But why should it be prefixed?

    Because Apple wants communication between apps to be by the containing app's bundleId and avoid devs having to go around and send messages to the bundleID of the app Extension.

    For example, your server must send a field named apns-topic to send a push notification to APNS so the app can download an image. The value of that topic is the bundleID.

    But it's not the bundle ID of the service extension. It's the bundleId of the main app itself.

    However on the actual physical phone, both the bundleIDs (com.alphabet.gmail.notificationServiceExtension and com.alphabet.gmail exist).

    So how does the OS deliver the notification to the app extension and not the main app?

    My understanding is that the OS looks for a target that:

    • Has a BundleId that is prefixed with com.alphabet.gmail example: Extension app bundle id: com.alphabet.gmail.notification
    • Has an NSExtensionPointIdentifier set to com.apple.usernotifications.service. You should not touch this value. It's just a pre-defined value by Apple.

提交回复
热议问题