react-native-heap icon indicating copy to clipboard operation
react-native-heap copied to clipboard

[IOS] Autocapture is not working on ios but works fine on android

Open jonaustin09 opened this issue 3 years ago • 11 comments

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

jonaustin09 avatar Nov 22 '21 18:11 jonaustin09

+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 avatar Nov 29 '21 21:11 MudassarSharifSandhu

@MudassarSharifSandhu did you find solution?

jonaustin09 avatar Nov 30 '21 19:11 jonaustin09

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"
    },
    ...
}

bnickel avatar Dec 01 '21 17:12 bnickel

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.

MudassarSharifSandhu avatar Dec 01 '21 18:12 MudassarSharifSandhu

simulator_screenshot_A111A183-4FE6-4F6D-8FE3-2DFBF73AA00F @bnickel check this happens now my code is not working

jonaustin09 avatar Dec 01 '21 21:12 jonaustin09

@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 avatar Dec 01 '21 22:12 bnickel

@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?

jonaustin09 avatar Dec 01 '21 23:12 jonaustin09

@bnickel I recheck it it works on android but on ios still got the error that i mentioned above

jonaustin09 avatar Dec 01 '21 23:12 jonaustin09

@bnickel should I add some thing in pod file for ios?

jonaustin09 avatar Dec 01 '21 23:12 jonaustin09

@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.

bnickel avatar Dec 02 '21 16:12 bnickel

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.

facundocastello avatar Dec 02 '21 18:12 facundocastello