"Application ... not registered" with React Native app on AWS Mobile Hub - react-native

I'm trying to learn and understand how AWS Mobile Hub works.
Based on I'm trying to create a React Native app from scratch and connect to a AWS Mobile Hub.
I followed the steps in the AWS Mobile React Native Starter # Use features in your app to create a React Native app from scratch.
Setup a new project in AWS Mobile Hub.
Used awsmobile init <ID> to setup the react project for AWS Mobile Hub.
Enabled User Sign-in on AWS Mobile Hub project.
Setup Authentication in the React Native project.
(ps. there is an error in the guidelines because 'Amplify' import is missing)
Run the app with npm run ios
No matter what I do, I alway get a 'Application ... has not been registered' error.
The example backend from 'AWS Mobile React Native Starter' does work.
I have tried to compare both AWS Mobile Projects, but cannot find what causes the 'Application ... has not been registered' error.
I want to understand this AWS Mobile Hub thing and want to be able to setup projects myself and know how to integrate it into apps.
Any help to solve this error is greatly appreciated.

Finally found the problem.
First I thought it was because index.ios.js and index.android.js were missing, but then saw those are not needed anymore.
Aparently, when doing an application from scratch, the created 'index.js' does not have the correct component name. Changing the wrong name in AppRegistry.registerComponent('wrongname', () => App); to the correct application name, matching aws_project_name in aws-exports.js, fixed the issue.
The app now loads. Hurray!
Next problem: when signing in I get a 'No Userpool' message. Checked all config and Mobile Hub project, but the user pool seems correctly configured...
Update: also found the issue with 'No userpool'. When debugging the application, I noticed that the configuration received by Amplify.configure function was undefined. But I copied this code:
import { withAuthenticator } from 'aws-amplify-react-native';
import {awsmobile} from './aws-exports';
from this AWS React Native Starter App tutorial. But apparently it is not working.
Replacing that bit by this:
import Amplify from 'aws-amplify-react-native';
import aws_exports from './aws-exports';
from
AWS Documentation » AWS Mobile » Developer Guide » AWS Amplify Library for React Native » Get Started
. Now it suddenly works.
Thanks AWS! Took me couple of nights to find :-/

I saw that problem before when there is a version of aws-amplify installed under aws-amplify-react-native. That happens when the version of aws-amplify installed on the project is not the one that requires aws-amplify-react-native. I hope everything goes well with your app.

Related

Video Calling in Expo React Native Application

I am building a React Native Application using Expo and I want to integrate a 1:1 video calling functionality in the app.
From what I have researched so far on the topic is that I can use SDKs of various libraries like Twilio, Videosdk, VoxImplant etc to implement that feature or I have to use WebRtc in native project alongwith some mechanism to create rooms using socket.io and node and then join users in that room (not completely sure about it but something like this)
But both of these solutions require me to make changes in native files which are not present in expo app by default for which I think I have to run expo run:android and then make require changes in files (correct me if I am wrong)
Although on web I think its relatively easy to implement video calling using vanilla js or react js.
My question is if I implement a webpage that has video calling function and try to open it in webview in my expo react native app will the functionality work on app or not? has someone tried this before.
As I was exploring options I came BigBlueButton APIs and another question on Stackoverflow that is using Webview to connect to BigBlueButton APIs. Can I use this logic to implement something in expo app without ejecting or using any sdks? Will it work
What would be the best way to implement video calling in my expo app
Thanks
Utilizing Expo, you are essentially using 'React Native for Web', and with the new functionality of Expo config-plugins, almost all packages for React Native with auto-linking can be made to work with your Expo app, or more-or-less can have Config Plugins created for them.
For your case, good news for you, you can make it all work on Expo managed workflow, just utilize expo-dev-client and the following library:
react-native-webrtc
There's an Expo config plugin for this package. So now all you have to do is just utilize the Web-based functionality of WebRTC, such as calling:
navigator.mediaDevices.getUserMedia()..
navigator.mediaDevices.enumerateDevices()..
navigator.*
And ensure it works properly on Web. Then, just make a platform hook at your App.js / First loaded module / before having these WebRTC based functionalities calling the aforementioned library's initializer. e.g:
import React, { useEffect } from "react";
import { Platform } from "react-native";
import { registerGlobals } from "react-native-webrtc";
...
Platform.OS !== "web" && useEffect(() => {
registerGlobals();
}, []);
...
One more thing you'd have to do is that for Web, have the <video> element and for native apps, resolve it to <RTCView>, so essentially you could also make a platform specific component/module that resolves to either the web-only <video> tag or the native <RTCView> based on platform, like the example above. Perhaps even have the imports be resolved based on dependencies if you face any errors importing 'registerGlobals' at Web, for example.

React native project crashing with Redux Toolkit

I'm using an Expo Bare Workflow setup with my React Native App.
I followed this guide EXACTLY https://redux-toolkit.js.org/tutorials/quick-start copy pasted everything.
Imported
import { store } from "./src/main/redux/store";
import { Provider } from "react-redux";
on my App.js but it crashes when I build the app for Expo Go testing using eas update. If I remove those two imports, the app works fine.
I've followed the quickstart guide exactly, so for the code you can refer to the quick start guide as it might be redundant if I still post it here.
There's no error message from the App because it crashes on startup. I do get one from xcode saying com.facebook.ABI46_0_0React.ExceptionsManagerQueue and the rest are some obscure messages

Can we use Realm in React Native project with Expo?

I am making a Mobile app in React Native with Expo.
Now I am thinking that I will use Realm to manage state in my project.
However, I am not sure that I can use Realm on Expo or not.
Expo is quite useful to create React Native Mobile Apps easily and quickly, but sometimes there are some conflict with some modules and libraries.
So, could you teach me that Realm can work on Expo or not?
Thank you,
Update 24 Jan 2022
The feature request was marked as Complete today.
I can confirm that Realm works with custom dev clients.
Here is an expo/example you can use to get started today --courtesy of the Realm team.
We won't be adding Realm to the Expo Go app (that you download from the App Store or Google Play Store) since we are limiting the amount of native third-party services that we include by default.
Update 2 July 2021
The feature request has been marked it as In Progress by the Expo team.
https://expo.canny.io/feature-requests/p/realm
It should be included as part of a custom development client, you can read more about custom development clients here https://blog.expo.dev/introducing-custom-development-clients-5a2c79a9ddf8
Previous answer
From the realm docs
Expo does not support Realm
Unfortunately, Expo does not support Realm. If you use the Expo CLI or create-react-native-app to create your React Native project, you will need to "eject" your Expo project to use Realm. The installation steps on this page do not use the Expo CLI.
https://docs.mongodb.com/realm/sdk/react-native/install/
It has been a feature request for expo since 2017 https://expo.canny.io/feature-requests/p/support-for-realm
Finally, Expo now works with realm.
Expo Announcement
Guide
not yet
you can check for support state from here:
https://expo.canny.io/feature-requests/p/support-for-realm
Yes, Expo now has a way of doing this using Custom Dev clients. Here is an example app from the Realm team.
https://github.com/expo/examples/tree/master/with-realm
You can also see this request is marked as complete on the Expo feature request site.
https://expo.canny.io/feature-requests/p/realm

React native Clevertap push notification integration

I am trying to integrate clevertap plugin into my application. I have followed below procedure:-
Installed react native clevertap plugin using this link and followed all the mention steps.
Also added firebase messaging package implementation in build.gradle
Added google_service.json file into app folder.
After doing plugin setting implemented Clevertap example and to enable push notification followed below procedure:-
Updating user profile by setting MSG-push flag to true.
When I am fetching profile information it's showing push-msg enabled as true
Still I am unable to get push notification on my device. Please let me know if I have miss anything while integration or why this problem occurs?
Also when I check with Clevertap dashoboard, its also showing Push-Msg as diabled. You can check in this image.

Appsflyer integration - out of store apk with React Native

I am trying with Appsflyer out of store apk integration with React Native, I have followed below mentioned steps -
Added app on Appsflyer account with com.reactnativetest package and 9apps_int as channel name.
Integrated react-native-appsflyer SDK in my React Native App, following the react-native-appsflyer documentation.
Have added initSDK with debug mode true and trackEvent Method in the code.
Have debug the app on phone, and I got the success response from initSDK and trackEvent.
Now when I look at the Appsflyer dashboard, it gives me "0" Organic & Non-Organic Install and there is no event also tracked in the dashboard.
I have also done the testing with AppsFlyer Integration Testing App, by whitelisting my device and testing the app again, but same result.
Please help me where I am wrong in this?
Do I need to upload the app on any store except play store/App store before testing, can't I test the app installs in debug mode?
Please help.
Thanks.
Did you also test with URL with media and campaign?
http://app.appsflyer.com/com.greatapp?pid=test&c=campaign_test_1&
I suppose at this stage it's easier to upload the app to the stores, you can always pull it back.