How do I check if the user has already registered before?

Hi,
Is there any method which can tell me if a particular email address has been registered or not?
I need this information to check if a Google plus user is using the same email address a as facebook user and try and combine both.
Also I have some custom user properties that get updated everytime I press the login with facebook method. (I’m using the same button for Sign-up and subsequent logins)
So what is the best way to go about checking the entire database for existing registrations?
iOS- Objective C.
Thank you

To see if a user has registered before you can perform data retrieval from the Users table:

        let query = BackendlessDataQuery()
        let userEmail = "foo@foo.com"
        query.whereClause = "email = '\(userEmail)'"
        let users = backendless.data.of(BackendlessUser.ofClass()).find(query)
        
        if( users.data.count > 0 )
        {
            // user exists
        }

Could you also give me a Objective-C version of this.

Actually line 3 & 4 is all I need.

Thanks.

Obj-C is not my forte… Please see the API/examples on this page:

https://backendless.com/documentation/data/ios/data_search_and_query.htm

Mark

Is it ok to use collections and persistence service like in your examples? I’m getting the result I need.









 BackendlessCollection *collection = [backendless.persistenceService find:[BackendlessUser class] dataQuery:query];

I’m asking this because I cant find those terms in the swift code you pasted above.
Trying to make sure its the best option available.

Thanks

Yes, this is totally fine. You might also want to set queryOptions.pageSize = 1 to minimize the payload, since all you need to know if there is a user or not.