Comments (5)
Newer Version of React Native is Available! | |
---|---|
ℹ️ | You are on a supported minor version, but it looks like there's a newer patch available - 0.73.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
from react-native.
Missing Reproducible Example | |
---|---|
ℹ️ | We could not detect a reproducible example in your issue report. Please provide either:
|
from react-native.
Please provide a repro
from react-native.
@cortinico I have updated the issue and added the native side code too
Code on React native side:
useEffect(() => {
// deep link logic for fresh app launch
if (navPath?.path && isReady && isFirstLaunch) {
const { path, screen } = navPath;
checkIsFirstLaunchProp(false);
if (!isfetchingUserInfo) {
NavigationService.navigateToScreen(path, screen);
}
}
}
const eventEmitter = new NativeEventEmitter(
NativeModules.RNEventEmitter,
);
const checkNavigationPath = async (obj, event) => {
setNavigationState(obj, event);
};
// listener for notification
const eventListener = eventEmitter.addListener('EventReminder', event => {
const obj = event?.body;
checkNavigationPath(obj, event);
});
// Removes the listener once unmounted
return () => {
eventListener.remove();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isReady]);
Android side code:
private void sendEvent(ReactContext reactContext, String eventName, @Nullable WritableMap params) {
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, params);
}
void checkPayload(Intent intent) {
String action = intent.getAction();
if(action != null && !action.isEmpty() && action.equals("NOTIFICATION_PAYLOAD_READ")) {
String payload = intent.getStringExtra("NOTIFICATION_PAYLOAD");
ReactInstanceManager mReactInstanceManager = getReactNativeHost().getReactInstanceManager();
ReactContext context = mReactInstanceManager.getCurrentReactContext();
WritableMap params = Arguments.createMap();
params.putString("eventProperty", payload);
if(context == null){
mReactInstanceManager.addReactInstanceEventListener(new ReactInstanceEventListener() {
public void onReactContextInitialized(ReactContext validContext) {
// Use validContext here
sendEvent(validContext, "EventReminder", params);
mReactInstanceManager.removeReactInstanceEventListener(this);
}
});
if (!mReactInstanceManager.hasStartedCreatingInitialContext()) {
// Construct it in the background
mReactInstanceManager.createReactContextInBackground();
}
}else {
// App in background
params.putBoolean("backgroundApp", true);
sendEvent(context, "EventReminder", params);
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SplashScreen.show(this);
checkPayload(getIntent());
}
from react-native.
@nehab5889 can you use the linked template provided here:
#43651 (comment)
from react-native.
Related Issues (20)
- (node:23249) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. HOT 2
- TypeError: _reactNative.AccessibilityInfo.announceForAccessibilityWithOptions is not a function HOT 2
- Touch events not responding, scroll events only working, app freezing, etc. HOT 5
- how to skip bundling js and assets when assemble android release build? HOT 4
- Autocomplete Failure in React Native TextInput with multiline={true} Prop (TextInput) HOT 2
- [!] Failed to load 'hermes-engine' podspec: [!] Invalid `hermes-engine.podspec` file: [!] Unable to locate the executable `cmake`. HOT 3
- [!] Failed to load 'hermes-engine' podspec: [!] Invalid hermes-engine.podspec file: [!] Unable to locate the executable cmake. HOT 5
- [0.74][iOS] Wrong state of Touchable components with React.Suspense on New Architecture HOT 10
- [!] Invalid hermes-engine.podspec file: [!] Unable to locate the executable cmake. HOT 8
- Android native module rejections are not instanceof Error HOT 1
- Could not find com.facebook.react:react-android:.:0.72.1 HOT 9
- Build issues with 0.71 RNSha256 XCode 15.3 HOT 4
- `fontVariant` doesn't work on iOS when using the new architecture
- UI problem with iOS floating keyboard in iPad. HOT 6
- TouchableWithoutFeedback does not support style HOT 1
- Cannot find EventEmitter for receivedTouches EventName[topTouchMove, topTouchEnd] on native library HOT 5
- RCTNativeAnimatedNodesManager.mm props is not a node HOT 1
- Unexpected scroll behaviors when using FlatList HOT 7
- When I integration react native with Existing Android Apps,I got a autolinking question. HOT 2
- Symbol not found: (_JSGlobalContextSetInspectable) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.