juliandramirez / react-native-user-identity Goto Github PK
View Code? Open in Web Editor NEWGet the user id configured for the device (iCloud recordID for iOS, email of a device account for android)
License: Apache License 2.0
Get the user id configured for the device (iCloud recordID for iOS, email of a device account for android)
License: Apache License 2.0
Hello,
First of all thank your for having created and for maintaining this package.
For iOS, when setting iosUserConfirmation to true, the following dialog opens:
[https://raw.githubusercontent.com/juliandramirez/react-native-user-identity/master/docs/img/ios-user-confirmation.png]
Is it possible to write in bold the "Sign In" text instead of the "Cancel" one?
If not, is it possible to unbold the "Cancel" text?
Thanks in advance
How can i get active email Id in android like, Is there any way to get current selected google play store email ID ?
Thank you in Advance
When submitting Apps to Testflight, Apple replies with an email that includes:
ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs. See https://developer.apple.com/documentation/uikit/uiwebview for more information.
Now, I was able to track down the UIWebView
s to this repo (find it too in my Firebase and FBSDK dependencies but just bumping to the latest version fixed it) but strangely enough I can find it anywhere on the code, only in the myApp/ios/build/
directory. Any help with this issue would be much appreciated as Apple can start rejecting Apps for this reason at any point now (at this point looks like is only a warning).
Thanks in advance.
Once the package is installed, i receive error on react-native run-ios
command:
Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening APP_NAME.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace APP_NAME.xcworkspace -configuration Debug -scheme APP_NAME -destination id=E6431465-C8E5-44C7-B314-7892A1D7DE6B
note: Building targets in dependency order
error: Multiple commands produce '/Users/denissdubinin/Library/Developer/Xcode/DerivedData/APP_NAME-dnjatakakjaxpiekqdjtnwmzpjts/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h'
note: Target 'react-native-user-identity' (project 'Pods') has copy command from '/Users/denissdubinin/dev/moneyonative/node_modules/react-native-user-identity/ios/DerivedData/RNUserIdentity/Index/Build/Intermediates.noindex/RNUserIdentity.build/Debug-maccatalyst/RNUserIdentity.build/DerivedSources/RNUserIdentity-Swift.h' to '/Users/denissdubinin/Library/Developer/Xcode/DerivedData/APP_NAME-dnjatakakjaxpiekqdjtnwmzpjts/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h'
note: Target 'react-native-user-identity' (project 'Pods') has copy command from '/Users/denissdubinin/dev/moneyonative/node_modules/react-native-user-identity/ios/DerivedData/RNUserIdentity/Index/Build/Intermediates.noindex/RNUserIdentity.build/Debug-maccatalyst/RNUserIdentity.build/Objects-normal/x86_64/RNUserIdentity-Swift.h' to '/Users/denissdubinin/Library/Developer/Xcode/DerivedData/APP_NAME-dnjatakakjaxpiekqdjtnwmzpjts/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h'
warning: duplicate output file '/Users/denissdubinin/Library/Developer/Xcode/DerivedData/APP_NAME-dnjatakakjaxpiekqdjtnwmzpjts/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h' on task: CpHeader /Users/denissdubinin/Library/Developer/Xcode/DerivedData/APP_NAME-dnjatakakjaxpiekqdjtnwmzpjts/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h /Users/denissdubinin/dev/moneyonative/node_modules/react-native-user-identity/ios/DerivedData/RNUserIdentity/Index/Build/Intermediates.noindex/RNUserIdentity.build/Debug-maccatalyst/RNUserIdentity.build/Objects-normal/x86_64/RNUserIdentity-Swift.h (in target 'react-native-user-identity' from project 'Pods')
** BUILD FAILED **
I have completed all steps in installation guide.
"react": "18.1.0",
"react-native": "0.70.6",
"yarn": "^1.22.19"
Would you be interested in a PR for an expo config plugin for this?
Is this something you've tried already?
Hello,
I'm using this package with react-native-firebase.
In their documentation, it's specified to set:
use_frameworks! :linkage => :static
With this setup, I get the following error even in a fresh project:
❯ yarn ios --simulator="iPhone 14"
yarn run v1.22.19
$ react-native run-ios '--simulator=iPhone 14'
[...]
note: Building targets in dependency order
error: Multiple commands produce '/Users/rob/SideProjects/mot/front/ios/DerivedData/mot/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h'
note: Target 'react-native-user-identity' (project 'Pods') has copy command from '/Users/rob/SideProjects/mot/front/node_modules/react-native-user-identity/ios/DerivedData/RNUserIdentity/Index/Build/Intermediates.noindex/RNUserIdentity.build/Debug-maccatalyst/RNUserIdentity.build/DerivedSources/RNUserIdentity-Swift.h' to '/Users/rob/SideProjects/mot/front/ios/DerivedData/mot/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h'
note: Target 'react-native-user-identity' (project 'Pods') has copy command from '/Users/rob/SideProjects/mot/front/node_modules/react-native-user-identity/ios/DerivedData/RNUserIdentity/Index/Build/Intermediates.noindex/RNUserIdentity.build/Debug-maccatalyst/RNUserIdentity.build/Objects-normal/x86_64/RNUserIdentity-Swift.h' to '/Users/rob/SideProjects/mot/front/ios/DerivedData/mot/Build/Products/Debug-iphonesimulator/react-native-user-identity/react_native_user_identity.framework/Headers/RNUserIdentity-Swift.h'
ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk /Users/rob/SideProjects/mot/front/ios/DerivedData/SDKStatCaches.noindex/iphonesimulator16.4-20E238-.sdkstatcache
cd /Users/rob/SideProjects/mot/front/ios
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk -o /Users/rob/SideProjects/mot/front/ios/DerivedData/SDKStatCaches.noindex/iphonesimulator16.4-20E238-.sdkstatcache
[...]
2023-07-24 18:41:10.665 xcodebuild[88159:723109] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
** BUILD FAILED **
]
Node.js v20.5.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I don't know how to fix that.
Any pist? @juliandramirez
I am working in react native app, where I have implement this package. After implementing I did not get any error in development mode, but after app publish, Firebase Crashlytics showing me crashes on regular crashes.
Project currently running on:
React Native: 0.63
React:16.13.1
Crashlytics log
Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {com.rdiscovery/com.rdiscovery.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.bridge.Promise.resolve(java.lang.Object)' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:5200)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5241)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2230)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7824)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
Caused By:
Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.bridge.Promise.resolve(java.lang.Object)' on a null object reference
at com.github.juliandramirez.rn.useridentity.RNUserIdentityModule$1.onActivityResult(RNUserIdentityModule.java:42)
at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:308)
at com.facebook.react.ReactInstanceManager.onActivityResult(ReactInstanceManager.java:758)
at com.facebook.react.ReactDelegate.onActivityResult(ReactDelegate.java:90)
at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:112)
at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:68)
at android.app.Activity.dispatchActivityResult(Activity.java:8320)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5193)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5241)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2230)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7824)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
See screenshot for your reference:
See Crash Statistics:
It shows total 19 devices are facing this crash after implementation.
Please note column named with "Device Current" is showing Android version.
Execution failed for task ':react-native-user-identity:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR:D:\Sajid\projects\temp\tempApp\node_modules\react-native-user-identity\android\build\intermediates\merged_res\release\values\values.xml:2722: AAPT: error: resource android:attr/lStar not found.
Hello! Thanks for making this package. I am trying to get it to work in my Expo app that I'm building for iOS. I'm calling getUserId
like this:
const fetchUserIdentity = async () => {
try {
const result = await RNUserIdentity.getUserId({});
return result;
} catch (error) {
return null;
}
};
where I pass an empty object to getUserId
because it requires an options
argument now it seems.
I am also having Expo request iCloud Storage permissions with:
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.myname.myapp",
"entitlements": {
"com.apple.developer.icloud-container-identifiers": [
"iCloud.com.myname.myapp"
]
}
}
in Expo's app.json file - not sure if this is correct either.
When the fetchUserIdentity
function above gets executed, my app crashes. Let me know if you have any ideas, thanks.
Code:
try {
const result = await RNUserIdentity.getUserId({
iosUserConfirmation: false,
});
if (result === null) {
alert('User canceled UI flow');
}
else {
handleEmail(result);
}
}
catch (error) {
console.log('error');
}
When running > ./gradlew bundleRelease
, I have this error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':react-native-user-identity:bundleLibRuntimeToJarRelease'.
> Could not create task ':react-native-user-identity:compileReleaseJavaWithJavac'.
> In order to compile Java 9+ source, please set compileSdkVersion to 30 or above
It happens since react-native 0.72.0 and is due to:
.android/build.gradle:
android {
compileSdkVersion 28
...
}
Possible fix: replace this by
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
...
compileSdkVersion safeExtGet('compileSdkVersion', 28)
I first added the package using the command:
yarn add react-native-user-identity
Here is the error I receive when calling GetUserId()
TypeError: Cannot read property 'getUserIdentity' of null, js engine: hermes
The next step is I generated a new iOS build and the build errored with the following:
Appreciate all the help!
I can't access the getUserId
function.
import RNUserIdentity, { ICLOUD_ACCESS_ERROR } from 'react-native-user-identity'
const checkAccount = async () => {
try {
const result = await RNUserIdentity.getUserId()
// const result = await RNUserIdentity.default.getUserId()
// const result = await RNUserIdentity.getUserIdentity()
if (result === null) {
onPressed?.(false)
if (alert) {
Alert.alert(
"iCloud Error",
"You have to enable iCloud to add your ID to your Apple Wallet"
)
}
}
else {
onPressed?.(true)
}
} catch (error) {
console.error(error)
if (error === ICLOUD_ACCESS_ERROR) {
if (alert) {
Alert.alert(
"iCloudError",
"Unable to access iCloud"
)
}
return onPressed?.(false, error)
}
throw error
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.