react-native-heap
react-native-heap copied to clipboard
[IOS] Autocapture is not working on ios but works fine on android
I followed the heap documentation and implement all steps but still I am facing issue that heap analytics shows nothing when I run my app on ios but works fine on android any help I am using react navigation 5
+1 I am facing the same issue. It works in android but not on ios simulator. In the Live mode there is no data from the IOS Simulator platform.
@MudassarSharifSandhu did you find solution?
This is an embarrassing mistake on my end. I broke logging to production by implementing some test functionality. There's a fix incoming, but a temporary workaround is to add an explicit URL to heap.config.json:
{
"default": {
"heapAutoInit": true,
"captureBaseUrl": "https://heapanalytics.com"
},
...
}
Hi @bnickel ,
After adding "captureBaseUrl": "https://heapanalytics.com"
to heap.config.json under all envirnments like default, dev and prod. It still is not capturing events.
@bnickel check this happens now my code is not working
@MudassarSharifSandhu You'll need to rebuild if you haven't already. The heap.config.json file gets built into the app as part of the iOS build process.
@abriandev Can you try rebuilding your app as well? Heap doesn't use react-native-get-random-values so I'm not sure where that error would be coming from.
@bnickel I already rebuild the project 3 times but still see this error but on android app run fine but now on android its not showing live changes on heap analytics does this line "captureBaseUrl": "https://heapanalytics.com" have any impact on android?
@bnickel I recheck it it works on android but on ios still got the error that i mentioned above
@bnickel should I add some thing in pod file for ios?
@abriandev You may try running pod install
in the ios directory to see if that does anything.
Android and iOS both consume the config file through build processes and native code, so the config change shouldn't impact JavaScript on either platform. I'm going to push a fix so you can revert the config change an try out 0.17.1 when it ships.
I've the same error and also I've this on xcode output:
boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics
2021-12-02 15:35:56.016852-0300 appname[25219:326979] [connection]
I don't know if that's related
Edit 1: Sorry, it wasn't related, @bnickel solution worked for me. This is my 'heap.config.json'
{
"default": {
"captureBaseUrl": "https://heapanalytics.com",
"heapAutoInit": true
},
"dev": {
"heapAutoInit": true,
"heapAppId": "xxxx"
},
"prod": {
"heapAppId": "xxxx",
"heapAutoInit": true
}
}
steps:
yarn start --reset-cache
pod install
product -> Clean Build Folder
Edit 2: Also just upgrading the package to 0.17.1 worked for me
Edit 3: Sorry for so many edits, but I had the problem again and I realize that it's just on one of the simulator. The solution was to delete the app from that simulator and run the build again.