Creating customers and claiming a device


#1

Hello there.

I just finished my prototype with Particle Core(going to upgrade to Photon soon).

Developed an Android app for my product. Put the client ID, client secret and the product ID in my resource file.After that, I implemented a screen to sign up as customer with signUpAndLogInWithCustomer function in Android SDK. Currently I’m successfully creating a customer without errors but there are no customers on my product console after this process. My question is does a customer need to claim a device to appear on my console?

And secondly, after I log in with my customer account I’m claming the Core with claimDevice function(its connected to the cloud while this process taking place and yes, going to use Device Setup Library after I upgrade to Photon). But cant get any publish event via this account. Why? Im claiming it with my customer account without errorrs. I guess I need to claim it with Spark Legacy Tinker app or Device Setup library after I upgrade to photon.

Thank you.


#2

Hi!

Can you show me how did you manage to create the customer using the client id and client secret please?

Thanks


#3

If you are using Simple Auth, the Device Setup (Mobile) library takes care of it for you. You set the product ID, client ID, and client secret in the device setup SDK.

If you are using Two-Legged Shadow Auth, you do need to create the customer and access token. That’s described here:


#4

the problem is that i’m not using xcode but b4i instead.


#5

As long as you can make REST API calls, everything that’s done by the iOS SDK can be done manually from a different environment. However, it’s way more work and as far as I know no one has done it, so a great deal of experimentation will be necessary.


#6

there is something I don’t understand.

I went to particle console and create the OAuth client Simple authenfication (I have the client id and client secret).

It’s after that I don’t understand.
On the tutorials, they say that the next step is to create the customer. How can the app create the customer if I still don’t know the productId? And even if I manually put it on the command, it says : {“ok”:false,“error”:“Product not found.”}


#7

If you want to walk through the steps of manually creating customers, you should follow the example in the link above. It shows the various tokens you need at each step, where you need to insert the product ID, etc…


#8

This is what i’m doing.

After creating the OAuth, i’m doing the “Create a product bearer token”.
This works, I now have a accessToken.

Now, how can the app know the productID for the next step???

In the steps, he is getting it directly from the web console. How does the app do this?


#9

Typically each product has a separate app, so you can hardcode the product ID in the app (or put it in a resource, plist, etc.).


#10

is it free to create a product?
It’s asking me for credit card number but it also says free for the first 100 devices.

Thanks


#11

Prototyping level products are free. It is possible that you need to have a credit card assigned to your account to create a product.


#12

When I call the Create a product bearer token, is this a POST or a GET command?


#13

When I call the Create a product bearer token, is this a POST or a GET command?

GET