public class IntentModule extends ReactContextBaseJavaModule
NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
IntentModule(ReactApplicationContext reactContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
canOpenURL(java.lang.String url,
Promise promise)
Determine whether or not an installed app can handle a given URL.
|
void |
getInitialURL(Promise promise)
Return the URL the activity was started with
|
java.lang.String |
getName() |
void |
openURL(java.lang.String url,
Promise promise)
Starts a corresponding external activity for the given URL.
|
void |
sendIntent(java.lang.String action,
ReadableArray extras,
Promise promise)
Allows to send intents on Android
For example, you can open the Notification Category screen for a specific application
passing action = 'android.settings.CHANNEL_NOTIFICATION_SETTINGS'
and extras = [
{ 'android.provider.extra.APP_PACKAGE': 'your.package.name.here' },
{ 'android.provider.extra.CHANNEL_ID': 'your.channel.id.here }
]
|
getCurrentActivity, getReactApplicationContextcanOverrideExistingModule, getConstants, hasConstants, initialize, onCatalystInstanceDestroypublic static final java.lang.String NAME
public IntentModule(ReactApplicationContext reactContext)
public java.lang.String getName()
require() this module
from javascript.public void getInitialURL(Promise promise)
promise - a promise which is resolved with the initial URLpublic void openURL(java.lang.String url,
Promise promise)
url - the URL to openpublic void canOpenURL(java.lang.String url,
Promise promise)
url - the URL to openpromise - a promise that is always resolved with a boolean argumentpublic void sendIntent(java.lang.String action,
ReadableArray extras,
Promise promise)
action - The general action to be performedextras - An array of extras [{ String, String | Number | Boolean }]