Android React Native Bridge How-To Guide
Objective
To provide a React Native App Developer with details on how to use the React Native Bridge to enable communication between React Native and the Android Bubbl Plugin.
Audience
React Native App Developer
Bubbl provides Information screens (Activities), that you may use, both for development purposes and as a part of your app. You can use these additions to your Native Bridge for triggering corresponding screens, they should NOT be used for production.
Add, as required, the Java method to your BubblSdkModule
file and the React Native code to your App.js
file.
Bubbl Inbox
This activity display a user's messages received from the Bubbl Platform
@ReactMethod
public void payloadActivity() {
BubblSdkManager.getInstance(getReactApplicationContext()).openPayloadActivity(getReactApplicationContext());
}
<!-- this is only a sample of how it might be used -->
<Button
title="<Your title here>"
onPress={ BubblSdk.payloadActivity() }
/>
Logs Activity
Not for RELEASE
This feature is to aid developer for debugging and testing purposes only, it must never be available to the Play Store.
Note
The content on this view may not have been displayed to users, but is used for underlying Bubbl Plugin functionality
This activity provides Bubbl logs:
@ReactMethod
public void logsActivity() {
BubblSdkManager.getInstance(getReactApplicationContext()).openLogsActivity(getReactApplicationContext());
}
<!-- this is only a sample of how it might be used -->
<Button
title="Logs Activity - Not for production"
onPress={ BubblSdk.logsActivity() }
/>
Map with geofences
Not for RELEASE
This feature is to aid developer for debugging and testing purposes only, it must never be available to the Play Store.
Note
The content on this view may not have been displayed to users, but is used for underlying Bubbl Plugin functionality
This activity provides locations of your venues on the map, data on campaigns and payloads:
@ReactMethod
public void mapActivity() {
BubblSdkManager.getInstance(getReactApplicationContext()).openMapActivity(getReactApplicationContext());
}
<!-- this is only a sample of how it might be used -->
<Button
title="Map Activity - Not for production"
onPress={ BubblSdk.mapActivity() }
/>
Updated almost 2 years ago