React-Native: Get the same unique device ID after reinstalling the application - react-native

I’m writing an app in React-Native and need some help concerning identifying the device after reinstalling the application.
What I need:
Get a unique device ID for every device for both Android and iOS.
The same ID should be returned even if the user uninstalls the application and installs it again.
The closest to this I’ve come over is the getUniqueID() method in react-native-device-info. However, a different ID will be returned on iOS if the app is reinstalled since the returned value for this method is related to the vendor.
Have a great day!

Well, if you need it due security purposes (e.g. so nobody is abusing your API or premium content), you are looking for Device Check / App Attestation for iOS and Google Safety Net for Android. By using these libs, you will get a unique device token (on iOS) or attestation (on Android).
When using iOS, you can take this token, and set up two bits on a server hosted directly in Apple by using your own server as a middle-man (as you should not do it directly, from the mobile app).
According to Apple: Apple records the bits for you and reports the bits back to you, but
you’re responsible for keeping track of what the bits mean. You’re
also responsible for determining when to reset the bits for a given
device; for example, when a user sells the device to someone else
Similarly, with Android - you just send attestation from device to server where it will be validated.
To use mentioned libs in React Native, you can either install corresponding libs:
https://github.com/dayitv89/react-native-ios11-devicecheck
https://github.com/rajivshah3/react-native-google-safetynet
plus you will need to implement verification part on your server
or if you are using Firebase libs (e.g. from rnfirebase.io), you can use AppCheck that uses SafetyNet and DeviceCheck / App Attestation underhood and comes also with easy server-side verification (also for non-Firebase resources).
If you need a solution that is focused on pushing data from server to client, you are looking for a push notification token.
Libs:
https://rnfirebase.io/messaging/usage
https://github.com/zo0r/react-native-push-notification
As this token can change over time (by design), you should implement few services that support that / or potentially re-architect your app.
Typically, tokens are stored under the user profile in your backend (or they are linked in some other way to the user that is using the device in the given time).
If you are looking for something else, I think it's not possible.

Don't worry MisseMask,
uniqueID's are always unique for your app bundle ID. There are two uniqueID's for each app.
That is one unique ID for debug version, and another one for release version. So please check your app by install it again and again with debug mode. now you get the same uniqueID. and do this process again with release build
for example:
Debug version uniqueID:
1st install - 3279dhsbqd9yrbceqiqbcv
2nd uninstall and install - 3279dhsbqd9yrbceqiqbcv
3, 4, 5, 6, .... - are same uniqueID
Release version uniqueID:
1st install - dsvfhdfgdf454tdsgsghetuh7j5
2 nd uninstall and install - dsvfhdfgdf454tdsgsghetuh7j5
3, 4, 5, 6, .... - are same uniqueID

Related

Update current published app(Appstore, GooglePlay) with freshly expo project

It is possible to update the current app from Appstore and GooglePlay from a new freshly expo project?
I lost all the code of the project from where app was build(the build was classic one)
Now I want to start a new / fresh expo project(EAS one) and:
Code the app again
Update the stores with new app
What's your thoughts about this?
What about the implications of the parts like: Storages, Tokens..?
Thank you
As long as you have access to the same AppStore and Google Play accounts yes, you could. Without referencing legacy code and configuration, however, it might not be possible to migrate user data persisted in storage etc. (unless you know the exact config used).
The differences between classic expo builds and EAS should not have any impact here. What matters is that the apps have the same bundle id / package name and are correctly signed (you must have access to the previous signing key or publish key for google play, for instance), and that all other native config items match (if the previous app supported iPads, for example, the new one must as well).

IBM MobileFirst 7.1.0 WL.Device.getID changes on the same device

mfp -v 7.1.0.00.20160401-2108
wladm -version 7.1.0.00.20160323-1606
WL.Device.getId sometimes returns different id on the same device with app reinstallation or update from Store.
It happens both on Android and iPhone.
It happens only when app is reinstalled (updated), or switched from debug to release.
When installed the ID is persistent.
We use LDAP server where DeviceID is login value. So when ID changes I see the completely new login value from same device.
What could be reason of this behavior?
Background information:
The device id generated by the MobileFirst SDK for android is stored in KeyStore file, and in iOS in keychain file. Both of these are not 100% guaranteed to keep the original stored values in cases such as application uninstallation/reinstallation/upgrade, end-user changing the device security settings or doing a factory reset.
For these reasons it is not a recommended pattern to use the WL.Device.getId value as the principal login value.
The recommended pattern is to use a unique user identity such as email, or username. Please note that future version of MFP may discontinue support for the WL.Device.getId API method.

wso2 emm apk version management using the WSO2 store

I am testing WSO2-Emm system for managing our android mobile app. We have an app for taxi drivers. We deploy it using our tablets and a single gmail account. Our problem is that google allows up to 10 signed in devices for a single google account.
I have tried to load the apk to the WSO2 store. The problem is that when I want to upload a new version of the same app I get a warning message saying that this APK already exists in the store. When I try to rename it and add it as a new apk it works. The problem is that when I go to App-Management, the application appears under 'installed'. The Emm system doesn't detect there is a new version.
To be more specific, my question is is there a way to manage mobile application versions using the WSO2 store and not the google play store.
If there is a way we can go on with this system. If not, we will stop testing it.
The only way I've figured out how update an already installed app is by going to the App Management tab, selecting your latest version of the app in question, and hitting the install button under the Roles tab (NOT the Users tab). It will send the install command to any devices listed under roles you have checked, even if they already have the app installed. Keep in mind this will install the app on all the devices, even devices that already have the version you're trying to put out.
It looks like you already know about the patch on EMM-686 that must be implemented in order to upload multiple versions of the same app to the Publisher. Just in case you want to confirm it's implemented correctly, see my answer here for instructions on how to implement it.

How can store my APP identity on specific iOS device?

How can I keep installation track of my app on particular iOS device? Actually I want to check that my app was installed on a device or its first time installation. I tried identifierForVendor but it got change on every install.
There are a couple of ways to do this.
Easiest would be to implement Google Analytics
If you have your own reporting, you could use a 3rd part library to identify the device its on and then send that info to you... such as:
https://github.com/QuickBlox/SuperSample-ios/tree/master/Classes/Helpers/DeviceHardware

autonomousSingleAppModePermittedAppIDs Key in Restrictions payload - iOS 7 MDM

I have recently started working with Apple Configurator to use features meant for Supervised devices.
In the Restrictions payload there's a key called autonomousSingleAppModePermittedAppIDs with the description below
Optional. Supervised only. If present, allows apps identified by the bundle IDs listed in the array to autonomously enter Single App Mode.
Availability: Available only in iOS 7.0 and later.
I tried sending this key in the restrictions payload with a couple of app identifiers, but could not find any change in the behaviour of the OS. The Guided Access allowed all apps to enter into the SingleApp mode.
What I understand (and expect) from this is we can allow a list of apps to enter Guided Access (Single App) mode and no other app except the allowed ones will be visible on the device. Can you help me understand the things I'm missing or misunderstanding.
I believe the idea of this key that application itself can request a guided mode (vs guided mode triggered by a user or AppLock profile).
I believe application should use following API to request a guided mode:
void UIAccessibilityRequestGuidedAccessSession(BOOL enable, void(^completionHandler)(BOOL didSucceed));
In the case, if it's not on this list, this request will be rejected.
P.S. A device needs to be supervised.
Apple Configurator doesn't have the settings to manage "autonomousSingleAppModePermittedAppIDs"
Instead I decided to manually edit a profile and include the appropriate XML with the above key (referenced from here).
Upon trying to install the modified profile, Configurator explicitly says "The profile must be installed by a Mobile Device Management server."
The profile will install fine if this key/value pair is removed.
It looks like you MUST use an MDM to install a profile for use with Autonomous Single App Mode.
I was not able to find autonomousSingleAppModePermittedAppIDs in Apple Configurator. Looks like need to buy Apple Profile Manager (OS X Server in the App Store) for this which costs about $20.