Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 10 app fails to register #33

Closed
triceam opened this issue Aug 11, 2016 · 7 comments
Closed

iOS 10 app fails to register #33

triceam opened this issue Aug 11, 2016 · 7 comments

Comments

@triceam
Copy link

triceam commented Aug 11, 2016

I have an app that works fine on iOS 9, but when running on iOS 10 (beta) in the simulator, I get the following error.

Inside of my DJISDKManagerDelegate instance, the sdkManagerDidRegisterAppWithError fails with the following message:

Attempt to copy metadata from another registered device is not permitted.(code:-4)

This is occurring in the following code (in the error handler):

extension ViewController : DJISDKManagerDelegate
{
    func sdkManagerDidRegisterAppWithError(error: NSError?) {

        guard error == nil  else {
            debug("Error:\(error!.localizedDescription)")
            return
        }

        debug("Registered, awaiting connection...")
        #if arch(i386) || arch(x86_64) ||
            //Simulator
            DJISDKManager.enterDebugModeWithDebugId("192.168.1.15")
        #else
            //Device
            DJISDKManager.startConnectionToProduct()

        #endif

    }

Note: This is on the iOS simulator, using the DJI Bridge app to a Phantom 3. This exact configuration works fine if I target the iOS 9 simulator. I have not tested on-device yet b/c I don't want to upgrade my iPade to iOS 10 yet.

This is happening using Xcode 8 Beta 5.
Aircraft: Phantom 3 Advance
Firmware: The latest - I don't see a way to access the firmware version, but the DJI Go app is not prompting me to update.
SDK: Version 3.2, from this release snapshot: https://github.com/dji-sdk/Mobile-SDK-iOS/releases/tag/v3.2

@dji-dev
Copy link
Contributor

dji-dev commented Aug 12, 2016

Hi @triceam, this error is related to the app registration issue, please try the following methods:

  1. Delete the apps on you iOS9 and iOS10 simulator and try again.
  2. Modify your Xcode project's bundle ID and apply for a new App Key from DJI developer website, then try again.

Try if these two methods work, let me know the result. Thanks!

@triceam
Copy link
Author

triceam commented Aug 12, 2016

I tried both of these things, but neither fixed it:

  1. I used "Reset Content & Settings" on the simulator to erase everything from it, but the problem did not go away. I received the exact same error message when I launched the app on the freshly cleaned simulator.
  2. I'm not able to test this right now... Looks like the DJI developer site is having problems. None of my apps are showing up, and it won't let me create a new one. I opened up the debug console in Chrome, and it looks like someone left a reference to a localhost dev environment (127.0.0.1) in the deployed app code (see screenshot below).

image

@dji-dev
Copy link
Contributor

dji-dev commented Aug 12, 2016

Hi, please try to create a new app key on DJI Developer Website, it should work now. Thanks!

@triceam
Copy link
Author

triceam commented Aug 12, 2016

I'm still seeing errors on the DJI Developer website. I emptied the cache and reloaded, but I get the same error mentioned above (references to 127.0.0.1:3000).

@dji-dev
Copy link
Contributor

dji-dev commented Aug 12, 2016

Sorry for the inconvenience, please try again, it should work now.

@triceam
Copy link
Author

triceam commented Aug 12, 2016

Created a new ID, and changed my bundle identifier, but no luck - I got the same error message. iOS 10 is much more strict on networking & App Transport Security settings... possibly, do we need to add specific DJI domains or IPs to exception domains?

@dji-dev
Copy link
Contributor

dji-dev commented Aug 15, 2016

Hi, since we use NSUserDefaults in SDK registration, and Xcode 8 Beta 1 has a bug related to NSUserDefault, please try to reboot your Mac and run iOS 10 simulator directly or upgrade your Xcode 8 to Beta2.

For more details, please check this stackoverflow:
http://stackoverflow.com/questions/37840288/ios-10-nsuserdefaults-does-not-work

Hope this help, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants