We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(at /node_modules/react-native-send-intent/android/src/main/java/com/burnweb/rnsendintent/RNSendIntentModule.java) among below codes
@ReactMethod public void openAppWithUri(String intentUri, ReadableMap extras, final Promise promise) { try { Intent intent = Intent.parseUri(intentUri, Intent.URI_INTENT_SCHEME); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Intent existPackage = this.reactContext.getPackageManager().getLaunchIntentForPackage(intent.getPackage()); if (existPackage != null) { this.reactContext.startActivity(intent); } else { Intent marketIntent = new Intent(Intent.ACTION_VIEW); marketIntent.setData(Uri.parse("market://details?id="+intent.getPackage())); marketIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.reactContext.startActivity(marketIntent); } promise.resolve(true); } catch (Exception e) { promise.resolve(false); } }
existPackage is always null, so App is not opening.
Guessing this.reactContext.getPackageManager().getLaunchIntentForPackage(intent.getPackage()); is not working at all.
I temporarily replaced
Intent existPackage = this.reactContext.getPackageManager().getLaunchIntentForPackage(intent.getPackage()); if (existPackage != null) { this.reactContext.startActivity(intent); } else { Intent marketIntent = new Intent(Intent.ACTION_VIEW); marketIntent.setData(Uri.parse("market://details?id="+intent.getPackage())); marketIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.reactContext.startActivity(marketIntent); }
to
this.reactContext.startActivity(intent);
and it works fine.
my current versions are
"dependencies": { "react": "17.0.2", "react-native": "0.66.3", "react-native-permissions": "^3.2.0", "react-native-send-intent": "^1.3.0", "react-native-webview": "^11.15.0" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "@types/jest": "^26.0.23", "@types/react-native": "^0.66.4", "@types/react-test-renderer": "^17.0.1", "babel-jest": "^26.6.3", "eslint": "^7.14.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.66.2", "react-test-renderer": "17.0.2", "typescript": "^4.4.4" },
The text was updated successfully, but these errors were encountered:
I rollbacked above's code replacement and added this code at AndroidManifest.xml file
<manifest> ... <permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <queries> <intent> <action android:name="android.intent.action.MAIN" /> </intent> </queries> </manifest>
and it works!
Sorry, something went wrong.
@tkmin thank you, good sir! You helped a lot
No branches or pull requests
(at /node_modules/react-native-send-intent/android/src/main/java/com/burnweb/rnsendintent/RNSendIntentModule.java)
among below codes
existPackage is always null,
so App is not opening.
Guessing
this.reactContext.getPackageManager().getLaunchIntentForPackage(intent.getPackage());
is not working at all.
I temporarily replaced
to
and it works fine.
my current versions are
The text was updated successfully, but these errors were encountered: