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

Error on signing up #8

Closed
ghost opened this issue Sep 9, 2015 · 3 comments
Closed

Error on signing up #8

ghost opened this issue Sep 9, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 9, 2015

using this example on the swift 2 branch, the app builds, Ive set up the cloud code side, parse shows its signing up the users through the login screen when the app builds and runs on my phone but i get a constant activity spinner and the following error:

2015-09-09 08:43:46.789 Layer-Parse-iOS-Swift-Example[48891:3291859] LayerKit client v0.15.0 loaded
Failed to connect to Layer: Error Domain=com.layer.LayerKit.Errors Code=6000 "The client is already in the process of establishing a connection." UserInfo={NSLocalizedDescription=The client is already in the process of establishing a connection.}
fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb)

        /*
        * 2. Acquire identity Token from Layer Identity Service
        */
        PFCloud.callFunctionInBackground("generateToken", withParameters: ["nonce": nonce, "userID": userID]) { (object:AnyObject?, error: NSError?) -> Void in
            if error == nil {
                let identityToken = object as! String
                self.layerClient.authenticateWithIdentityToken(identityToken) { authenticatedUserID, error in
                    if (!authenticatedUserID.isEmpty) {
                        if (completion != nil) {
                            completion(success: true, error: nil)
                        }
                        print("Layer Authenticated as User: \(authenticatedUserID)")
                    } else {
                        completion(success: false, error: error)
                    }
                }
            } else {
                print("Parse Cloud function failed to be called to generate token with error: \(error)")
            }
        }
    }
}

getting a Thread 1: Exc Breakpoint on this line of code " if(authenticatedUserID.isEmpty){

@kwkhaw
Copy link
Owner

kwkhaw commented Sep 9, 2015

@lhumphreys73 Thanks for reporting the issue. The app (swift 2 branch) seems like is running fine on both simulator and my iPhone (iOS 9 beta 3).
In order to isolate the issue, can you provide me these info?
Do you encounter the same problem:

  1. on Xcode 7 simulator? (By the way, what is your Xcode 7 version?)
  2. with Xcode 6 on both simulator and iPhone?
  3. with https://github.com/layerhq/Layer-Parse-iOS-Example project?
    If none of the above works, probably it is your Parse Cloud Code or configuration issue?
    If any of the above works, then... mmm.. let me think. 😛

@ghost
Copy link
Author

ghost commented Sep 10, 2015

Thank you, resolved, it was a configuration issue.

@ghost ghost closed this as completed Sep 10, 2015
@kwkhaw
Copy link
Owner

kwkhaw commented Sep 10, 2015

@lhumphreys73 👍 You're welcome.

This issue was closed.
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

1 participant