How do i get the device id after setup is complete on Android react native?

Tags: #<Tag:0x00007fe226645900>


I have react native app with the android device setup library implemented. I am able to setup a photon but i am having difficultly getting the device id once setup is complete. Does anyone have an idea on how to get the device id in a react native app once device setup is complete?

I am using the docs as reference just not sure how to implement this native code into a react native app.


I still have not been able to figure this out. Anyone got any ideas?


I wouldn’t recommend using React Native at all for anything ever. It was a mistake that many companies have retreated from, due to surprising and growing complexity as well as poor performance. Basically, you pay more to get less.

But if you must use RN for the setup process, you can use the native Android Setup library, and pass the result back through React Native bridges ( Or, you may try using the JS setup library ( from React Native, and get the device-id that way. From what I’ve heard, Flutter seems like a much more performant mutliplatform technology, but your app size will still be bigger than a native app. This is also an issue for React Native. If you have the option though, I’d go full native.


I can’t help with React Native specifically, but what you’ll need to research is how to receive Android “broadcasts”/“broadcast intents”.

I recommend starting a separate toy project to play around with sending & receiving broadcasts using React Native (I assume they must have some mechanism for doing this on Android), and once you’ve got that figured out, then come back to trying to receive the ID for device setup.


Thanks will definitely consider this approach.