From the docs:
I have to add this to the AppDelegate.m file:
FIRAppCheckDebugProviderFactory *providerFactory =
[[FIRAppCheckDebugProviderFactory alloc] init];
[FIRAppCheck setAppCheckProviderFactory:providerFactory];
// Use Firebase library to configure APIs
[FIRApp configure];
Managed to do this and to start my react native app.
However:
Launch the app. A local debug token will be logged when the SDK tries to send a request to the backend. For example:
I have no way of accessing the logs produced by the simulator.
In the Terminal window I can only see logs generated by React Native, and when opening the System Log in the iOS simulator this is all I get:
Jul 30 12:11:56 **** syslogd[55934]: --- syslogd restarted ---
Jul 30 12:11:56 **** syslogd[55934]: Configuration Notice:
ASL Module "com.apple.contacts.ContactsAutocomplete" claims selected messages.
Those messages may not appear in standard system log files or in the ASL database.
I can't run the project from inside Xcode as I get build errors on some of the postbuild steps. I run it using yarn ios which maps to react-native run-ios in package.json
How do I access the printed debug token in order to get App Check working when running my app in a simulator? How do I get the logs the iOS simulator is generating as we normally see in Xcode when running a native app?
Note: I have a lot of experience with native iOS development and with JS development, but this is my first time working on a React Native app (external codebase I am supposed to do some maintenance on).
Related
I'm building an app with Ionic 6 + capacitor. It works fine when testing on the browser and the Android build. However, when I try to build it using XCode it just doesn't work: it only shows a blank page.
If I run the command ionic capacitor run ios -l --external from Webstorm, the iphone emulator starts and everything works fine. If I open the project with XCode and click the play button, it shows the emulator with a blank page.
My capacitor.config file is:
{
"appId": "com.ionic.app",
"appName": "ionic-app",
"webDir": "www",
"bundledWebRuntime": false,
}
The console of XCode when starting the app is:
2021-12-30 17:09:09.817042+0100 App[22182:360758] KeyboardPlugin: resize mode - native
⚡️ Loading app at capacitor://localhost...
⚡️ [log] - Angular is running in development mode. Call enableProdMode() to enable production mode.
⚡️ WebView loaded
⚡️ To Native -> App addListener 101717497
Notice that localhost doesn't show the usual 8100 port.
The problem is that when I run the app via XCode, the angular server is not starting, hence the app is only a blank page. If I start the server via ng run app:serve --host=0.0.0.0 --port=8100 and I add the following config to capacitor.config in XCode:
"server": {
"url": "http://localhost:8100"
}
Then everything works fine again.
Is there any command or any capacitor config I would need to include to start the angular server when the app starts? Or I don't need to start it and the problem may be somewhere else?
Thanks in advance
UPDATE:
The problems seems to be in the auth guard. I still have to find out what exactly causing the problem, but without the guard the app works fine.
You can run 2 ways your project:
Live Reload
Built app
Live Reload is a good way for debugging the Mobile App, because you will see the changes in 1 sec.
For Built app, you need to do a lot of process:
Run ng build and check where it's build (usually dist/nameoftheproject)
Go to capacitor config.ts and change "webDir": "www" to webDir: "dist/nameoftheproject"
Remove the server property in capacitor.config.ts (It's only for Live Reload)
Run npx cap sync
Then npx cap open ios for opening Xcode
Now, that's why people prefer using "Live Reload" for debugging because using the "Built app way" it's too long to see every change.
Edit: In fact, when you finish your app, you need to build it again if you plan to publish it on the App Store.
So that's how you will see your app in Xcode. Good luck! <:)
How can i view the logs for an app that runs in release mode (flutter run --release) on iOS (14.5) physical device? I tried logging with print, debugPrint nothing gets printed in the OS X console app (/System/Applications/Utilities/Console.app). i also tried in the terminal the 'flutter logs -v' command, nothing no logs or errors running this command.
You could use sentry.io, which lets you track errors and performance. They have an SDK for flutter and installing/implementing instructions to get started, once you setup a project.
Sentry is open-source and has paid options as well.
I don't know how you have built your backend, but if you use firebase you can use their crashlytics solution.
I've a few apps connected to my firebase project. Recently one of those apps..an iOS app... crashes while launching on my simulator. The output is:
└─Compiling, linking and signing... 20.3s
Xcode build done. 59.8s
Configuring the default Firebase app...
[Crashlytics] Version 3.14.0 (144)
Configured the default Firebase app __FIRAPP_DEFAULT.
[Fabric] [Fabric +with] called multiple times. Only the first call is honored, please pass all kits you wish to initialize
Error connecting to the service protocol: failed to connect to http://127.0.0.1:57399/MD_uhGLIBGA=/
The iOS app doesn't have Crashlytics or Fabric installed. So I presume it's something that's changed with firebase. I added a web app to the project which has analytics installed(not Crashlytics). I think it's since then my problem started. Is there a way for my client app to " forget" about the crashlytics service?
I want to be able to test an app created with react-native init through the expo app downloaded from the app store. How can I do this?
I'm trying to use pure react native (no expo at all) and want to test my code on my iOS device. A while ago, I was able to do this through the expo app simply by running npm start. However, now when I run npm start I only see Running Metro Bundler on port 8081..
You cannot run a project created with react-native init with the Expo app. However, you can use https://snack.expo.io/ to test plain React Native code in either the browser emulator or on your device (which will open through the Expo app) by pointing your iOS camera app at the QR code they display for you. The caveat to this is that you cannot use native modules within a Snack.
Depending on the size of your app, you can port your code over from react-native init into a freshly created expo project. I have managed to do this on several projects in the past with great success. The process can be tedious depending on the age of your dependencies however.
I am trying to integrate Crashlytics with Xamarin.iOS. I have successfully added a binding and started the logger with my API key. I'm able to crash the app but no reports are landing on the web dashboard. When adding Crashlytics to an xcode project it prompts you to add a build phase task to run a script (Which I believe uploads your symbol files to their website).
./Crashlytics.framework/run APIKEY
After creating a binding of the framework for Xamarin this doesn't work as expected... I haven't added a build task in Xamarain Studio but running the command from the terminal yeilds:
MacBook-Pro:Crashlytics.framework user$ ./run APIKEY
2013-09-04 16:10:49.941 run[9238:707] Crashlytics.framework/run 1.2.3
2013-09-04 16:10:49.943 run[9238:707]
Crashlytics: Failed to Detect Build Environment
BUILT_PRODUCTS_DIR value not found in environment
So finally the question:
How do you integrate this build script into the Xamarin environment? Do I need to copy more assets around to trick the run command into thinking all is well?
Latest versions of Xamarin Studio support Crashlytics out of the box:
We had been using Crashlytics with our Xamarin project. But, it seems with Xamarin.iOS 8.6 and/or Xamarin Studio 5.7 it is no longer supported, and the Crashlytics APIs have changed.
Here are the steps I used.
In the Xamarin Studio , go to the touch container and add the Crashlytics API key in the Build -> Crash reporting section. Build and run that app. The evidence suggests that is enough to get data sent to Crashlytics. I saw that it knew about older versions of the app I had built and ran weeks ago with the API key already in.
Go to Xcode and create a new project with the same name as the Xamarin project, com.{company}.{appname}. (You probably need to have that profile downloaded.) I did it in Swift by the way with no issues.
Go to crashlytics.com com and go to settings -> Apps (or https://www.crashlytics.com/onboard)
You will get an app to download and run. The app walks through the steps of adding
A build phase run script
Code to the application main Crashlytics.startWithAPIKey(“nnnn”)
Run your Xcode version of the app
The Crashlytics web page popped up immediately.