Error on registering in iOS

Answered

Comments

11 comments

  • Avatar
    Max Konev

    Hi,

    It is a known problem with Phonegap Build and we have notified them about 6 months ago, but it still not fixed :( The problem that PGB don't put correct push entitlements into the executable during the build process. The entitlements section goes right before Codesign section in the executable. And after receiving executable from PGB system - that section is empty and not containing push entitlements from provisioning profile! Unfortunately this is not about the plugin, this is about PGB build server :(

    This is 100% confirmed with Apple Developers Provisioning Profile.

    AdHoc and Production profile should work fine (that's why I suppose PGB team doesn't hurry fixing this bug). However there have been some cases reported when Production profiles didn't work as well. If you receive this message with AdHoc/Production profile I would suggest recreating profile in the Apple Developers Portal.

    Of course please make sure you have "aps-environment" string in the mobieprovisioning profile!

    I would suggest opening a support ticket to PGB team as well, they really need to fix this bug!

    Thanks!

  • Avatar
    vishnurajreubro

    I'm now using AdHoc profile. How can I fix this? I tried creating a new adhoc profile. But same effect.

  • Avatar
    Max Konev

    Well. There are some ways how to fix this. But you'll definitely need a mac for this:

    • Use codesign utility to resign the IPA (.app) with the profile. This way the entitlements will be included in the executable correctly. Just download the build from PGB and re-sign it with the profile. See more here:

    http://stackoverflow.com/questions/6896029/re-sign-ipa-iphone

    Also some tech docs from Apple: https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html

    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/codesign.1.htmlWrite

    • Open the ticket with PhonegapBuild support as well to push them fixing this issue.

    Thanks!

  • Avatar
    vishnurajreubro

    Shader,

    I have no mac machine. :( Will try with my frnd's mac.

    I have posted the issue in PG community.

    http://community.phonegap.com/nitobi/topics/push_registration_fail_on_ios

  • Avatar
    Max Ellinger

    I'm having the exact same issue with Phonegap build. Unfortunately the re-signing instructions on StackOverflow are giving me a hard time, specifically this part:

    /usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --resource-rules "Payload/Application.app/ResourceRules.plist" "Payload/Application.app"

    Because there is no ResourceRules.plist in the app folder I end up getting: Payload/App.app/ResourceRules.plist: cannot read resources

    I'm also using the production profile and certificate.

  • Avatar
    Max Ellinger

    https://twitter.com/dino_krs/status/426390489114636288

    It looks like things aren't going too well at Phonegap right now. I'm thinking maybe his issue could be linked to ours?

  • Avatar
    Max Konev

    It does look like the reason!

  • Avatar
    Max Konev

    That's very strange. You must have ResourceRules.plist in the .app file. It tells the system not to hash Info.plist for example during the codesigning procedure.

  • Avatar
    Max Ellinger

    Looks like there's a lot of strange things going on with them, just look at this thread! http://community.phonegap.com/nitobi/topics/embedded_mobileprovision_is_missing

    Thanks for shedding some light on this, shader — after being alone with the Phonegap Build forum for so long it's nice to get responses.

  • Avatar
    vishnurajreubro

    This issue is solved now. Registered successfully and got token.

    Thnks

  • Avatar
    Max Konev

    Did PGB guys fix this? You can accept your answer.

Please sign in to leave a comment.