Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft #163

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

draft #163

wants to merge 1 commit into from

Conversation

fabriziomoscon
Copy link
Collaborator

@fabriziomoscon fabriziomoscon commented Nov 13, 2020

Android receives a background call with broadcast receiver and pass it to RN headless JS

// Application index.js
AppRegistry.registerHeadlessTask('BackgroundCallTaskService', () => ({
    call_state,
    call_sid,
    call_from, // this is the phone number or contact string from twilio
    call_to,
}) => {
    console.log('####### CALL RECEIVED')
    if (callState === 'PENDING') {
        // this needs to call the Android Phone app, because it is not possible to start the RN activity
    }
    return Promise.resolve();
});

Application AndroidManifest.xml

<service android:name="com.hoxfon.react.RNTwilioVoice.BackgroundCallTaskService"/>

<receiver android:name="com.hoxfon.react.RNTwilioVoice.BackgroundCallReceiver" android:exported="true">
    <intent-filter>
        <action android:name="com.hoxfon.HoxFon.DEV.debug.BACKGROUND_CALL" />
    </intent-filter>
</receiver>

@jdegger
Copy link
Collaborator

jdegger commented Nov 13, 2020

@fabriziomoscon great work, let me know when you want me to test and review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants