question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Additional improvements in headless mode

See original GitHub issue

Hello, I would like to create PR with additional improvements related to headless mode. Before I create PR please let me know if it’s needed. My previous PR (#221 ) was left without any response so I’m trying to implement needed features on my fork and I can share them with community.

But let’s go back to new improvements: I took code from @manuquentin (#223) and added a few changes:

  • I left old functionality of backToForeground, just added improvement for silent fail in the headless mode
  • I introduced a new method openAppFromHeadlessMode which can take callUUID and saves it
  • Whenever we want (especially after a cold boot) we can use another method getExtrasFromHeadlessMode and redirect to user’s call UI

With this PR we would be able to drop additional dependency like react-native-invoke-app.

Demo:

messaging().setBackgroundMessageHandler(async notificaiton => {
    return startCallFromBackgroundAndroid(notificaiton.data, headlessMode)
})

const startCallFromBackgroundAndroid = (payload, isHeadless) => {
    // setup RNCallKeep
   // set available

   RNCallKeep.addEventListener('answerCall', ({ callUUID }) => {
      RNCallKeep.openAppFromHeadlessMode(callUUID)
  })
}

// Later eg. after navigation did mount:

useAsyncEffect(async () => {
  const extras = await RNCallKeep.getExtrasFromHeadlessMode()

  if (extras) {
     navigation.navigate(ScreenNames.CallScreen, {
         roomUUID: extras.callUUID
     })
  }

}, [])

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
jpudyszcommented, Aug 10, 2020

Hello everyone, I’m super busy and I can’t contribute here, what’s more, we are far behind each other. You can check my repo with a few additional improvements for Android (https://github.com/jpudysz/react-native-callkeep) - tested on production as I’m developing for my client’s VoIP app.

I tried to create PR here, but I changed backToForeground logic and it differs from original repo. New functionality such as headless mode, locked screen are strictly connected with this function and I can’t merge it. Ideally, we can take my ideas and merge it with the master (I don’t mind and you can copy-paste my code under your PR). Ping me if I needed.

PS. I added changelog inside my repo, so you can check new functionalities. @manuquentin if you want to discuss how to merge it or you need some explanation ping/PM me.

2reactions
jpudyszcommented, Jul 1, 2021

I’m happy that I was able to help someone. Cheers from Poland!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Headless Mode for Your Tests - When, Why and How
Test Automation engineers use headless browsers to run their automated scripts faster and in Continuous Integration and Delivery pipelines.
Read more >
What is Google Chrome Headless Mode - DebugBar
The headless mode of the Google Chrome browser provides the ability to implement and run massive-scale web app tests, navigate from one page...
Read more >
Headless Edit Mode – A non-scary way of working with “pure ...
Headless -only mode can be configured by developers. When enabled, the Multi-Channel Content gadget appears and hides the Navigation view (Pages, ...
Read more >
Is Headless the smart way to go? - Numpy Ninja
Headless mode is not to run your program faster but headless mode makes your system memory utilization less and so better performance while ......
Read more >
Why Should I Run My Selenium Tests in Headless? - SmartBear
Greater testing reach; Improved speed and performance; Multitasking. Greater testing reach. When running Selenium tests, you typically need a machine that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found