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

Need to get collection data without user login.... #5

Open
manojguptainext opened this issue Jan 31, 2018 · 3 comments
Open

Need to get collection data without user login.... #5

manojguptainext opened this issue Jan 31, 2018 · 3 comments

Comments

@manojguptainext
Copy link

Hi,

I don't need use login in app and need to access collection() data without user login, is there possible in sdk?

@heyzooi
Copy link
Contributor

heyzooi commented Jan 31, 2018

Hi @manojguptainext,

Thanks for your question. You can autogenerate a user as described in our iOS Guide so this way people can download and start using your app without login and then later on if they decide to log-in you can link the autogenerated user to the user's authentication.

@manojguptainext
Copy link
Author

User.signup { user, error in
if let user = user {
//success
} else {
//error
}
}

Please check this error i am getting when i call signup function

expression produced error: error: /var/folders/lj/5bwrz2156vv6s0kgqxs1qhsm0000gn/T/expr12-f7a657..swift:1:80: error: 'Error' is ambiguous for type lookup in this context
Swift._DebuggerSupport.stringForPrintObject(Swift.UnsafePointer<Swift.Optional>(bitPattern: 0x11f4f4320)!.pointee)
^~~~~

Swift.Error:99:17: note: found this candidate
public protocol Error {
^

Kinvey.Error:2:13: note: found this candidate
public enum Error : Error, LocalizedError, CustomStringConvertible, CustomDebugStringConvertible {
^

@heyzooi
Copy link
Contributor

heyzooi commented Feb 5, 2018

It looks that Kinvey.Error is conflicting with Swift.Error, so try the code below, it should solve your problem:

User.signup { (user: User?, error: Swift.Error?) in
    if let user = user {
        //success
    } else {
        //error
    }
}

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

2 participants