Coder Social home page Coder Social logo

react-native-webrtc / react-native-incall-manager Goto Github PK

View Code? Open in Web Editor NEW
540.0 16.0 188.0 321 KB

Handling media-routes/sensors/events during a audio/video chat on React Native

License: ISC License

Java 67.82% JavaScript 2.94% Objective-C 28.78% Ruby 0.46%

react-native-incall-manager's Introduction

react-native-incall-manager

npm version npm downloads

Handling media-routes/sensors/events during a audio/video chat on React Native

Purpose:

The purpose of this module is to handle actions/events during a phone call (audio/video) on react-native, ex:

  • Manage devices events like wired-headset plugged-in state, proximity sensors and expose functionalities to javascript.
  • Automatically route audio to proper devices based on events and platform API.
  • Toggle speaker or microphone on/off, toggle flashlight on/off
  • Play ringtone/ringback/dtmftone

Basically, it is a telecommunication module which handles most of the requirements when making/receiving/talking with a call.

This module is designed to work with react-native-webrtc

TODO / Contribution Wanted:

  • Make operations run on the main thread. ( iOS/Android )
  • Fix iOS audio shared instance singleton conflict with internal webrtc.
  • Detect hardware button press event and react to it.
    ex: press bluetooth button, send an event to JS to answer/hangup.
    ex: press power button to mute incoming ringtone.
  • Use config-based to decide which event should start and report. maybe control behavior as well.
  • Flash API on Android.

Installation:

From npm package: npm install react-native-incall-manager
From git package: npm install git://github.com/zxcpoiu/react-native-incall-manager.git

===================================================

Android:

note: you might need android.permission.BLUETOOTH permisions for Bluetooth to work.

After install, you can use rnpm (npm install rnpm -g) to link android.
use react-native link react-native-incall-manager to link or manually if you like.

We use android support library v4 to check/request permissions.
You should add compile "com.android.support:support-v4:$YOUR_VERSION" in $YOUR_PROJECT/android/app/build.gradle dependencies on android.

Manually Linking

If react-native link doesn't work, ( see: https://github.com/zxcpoiu/react-native-incall-manager/issues/21#issuecomment-279575516 ) please add it manually in your main project:

  1. In android/app/build.gradle
    Should have a line compile(project(':react-native-incall-manager')) in dependencies {} section

  2. In android/settings.gradle
    Should have:

    include ':react-native-incall-manager'
    project(':react-native-incall-manager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-incall-manager/android')
    
  3. In MainApplication.java

    import com.zxcpoiu.incallmanager.InCallManagerPackage;
    private static List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new InCallManagerPackage(),
    
        );
    }

Optional sound files on android

If you want to use bundled ringtone/ringback/busytone sound instead of system sound,
put files in android/app/src/main/res/raw
and rename file correspond to sound type:

incallmanager_busytone.mp3  
incallmanager_ringback.mp3  
incallmanager_ringtone.mp3 

On android, as long as your file extension supported by android, this module will load it.

===================================================

ios:

react-native link react-native-incall-manager

Using CocoaPods

Update the following line with your path to node_modules/ and add it to your Podfile:

pod 'ReactNativeIncallManager', :path => '../node_modules/react-native-incall-manager'

Manually Linking

In case react-native link doesn't work,

  • Drag node_modules/react-native-incall-manager/ios/RNInCallManager.xcodeproj under <your_xcode_project>/Libraries
  • Select <your_xcode_project> --> Build Phases --> Link Binary With Libraries
    • Drag Libraries/RNInCallManager.xcodeproj/Products/libRNInCallManager.a to Link Binary With Libraries
  • Select <your_xcode_project> --> Build Settings
    • In Header Search Paths, add $(SRCROOT)/../node_modules/react-native-incall-manager/ios/RNInCallManager

Clean project if messed up:

The installation steps are a bit complex, it might be related your xcode version, xcode cache, converting swift version, and your own path configurations. if something messed up, please follow steps below to clean this project, then do it again steps by steps.

  1. Delete all project/directory in xcode related to incall-manager
  2. Delete react-native-incall-manager in node_modules ( rm -rf )
  3. Xcode -> Product -> clean
  4. Close xcode
  5. Run npm install again
  6. Open xcode and try the install process again steps by steps

If someone knows a simpler way to set this project up, let me know plz.

Optional sound files on iOS

If you want to use bundled ringtone/ringback/busytone sound instead of system sound

  1. Add files into your_project directory under your project's xcodeproject root. ( or drag into it as described above. )
  2. Check copy file if needed
  3. Make sure filename correspond to sound type:
incallmanager_busytone.mp3
incallmanager_ringback.mp3 
incallmanager_ringtone.mp3 

On ios, we only support mp3 files currently.

Usage:

This module implements a basic handle logic automatically, just:

import InCallManager from 'react-native-incall-manager';

// --- start manager when the chat start based on logics of your app 
// On Call Established:
InCallManager.start({media: 'audio'}); // audio/video, default: audio

// ... it will also register and emit events ...

// --- On Call Hangup:
InCallManager.stop();
// ... it will also remove event listeners ...

If you want to use ringback:

// ringback is basically for OUTGOING call. and is part of start().

InCallManager.start({media: 'audio', ringback: '_BUNDLE_'}); // or _DEFAULT_ or _DTMF_
//when callee answered, you MUST stop ringback explicitly:
InCallManager.stopRingback();

If you want to use busytone:

// busytone is basically for OUTGOING call. and is part of stop()
// If the call failed or callee are busing,
// you may want to stop the call and play busytone
InCallManager.stop({busytone: '_DTMF_'}); // or _BUNDLE_ or _DEFAULT_

If you want to use ringtone:

// ringtone is basically for INCOMING call. it's independent to start() and stop()
// if you receiving an incoming call, before user pick up,
// you may want to play ringtone to notify user.
InCallManager.startRingtone('_BUNDLE_'); // or _DEFAULT_ or system filename with extension

// when user pickup
InCallManager.stopRingtone();
InCallManager.start();

// or user hangup
InCallManager.stopRingtone();
InCallManager.stop();

Also can interact with events if you want: See API section.

import { DeviceEventEmitter } from 'react-native';

DeviceEventEmitter.addListener('Proximity', function (data) {
    // --- do something with events
});

Automatic Basic Behavior:

On start:

  • Store current settings, set KeepScreenOn flag = true, and register some event listeners.
  • If media type is audio, route voice to earpiece, otherwise route to speaker.
  • Audio will enable proximity sensor which is disabled by default if media=video
  • When proximity detects user close to screen, turn off screen to avoid accident touch and route voice to the earpiece.
  • When newly external device plugged, such as wired-headset, route audio to an external device.
  • Optional play ringback

On stop:

  • Set KeepScreenOn flag = false, remote event listeners, restore original user settings.
  • Optionally play busytone

Custom Behavior:

You can customize behavior using API/events exposed by this module. See API section.

Note: iOS only supports auto currently.

API:

Methods

Method android ios description
start({media: ?string, auto: ?boolean, ringback: ?string}) πŸ˜„ πŸ˜„ start incall manager.
ringback accept non-empty string or it won't play
default: {media:'audio', auto: true, ringback: ''}
stop({busytone: ?string}) πŸ˜„ πŸ˜„ stop incall manager
busytone accept non-empty string or it won't play
default: {busytone: ''}
turnScreenOn() πŸ˜„ 😑 force turn screen on
turnScreenOff() πŸ˜„ 😑 force turn screen off
setKeepScreenOn(enable: ?boolean) πŸ˜„ πŸ˜„ set KeepScreenOn flag = true or false
default: false
setSpeakerphoneOn(enable: ?boolean) πŸ˜„ 😑 toggle speaker ON/OFF once. but not force
default: false
setForceSpeakerphoneOn(flag: ?boolean) πŸ˜„ πŸ˜„ true -> force speaker on
false -> force speaker off
null -> use default behavior according to media type
default: null
setMicrophoneMute(enable: ?boolean) πŸ˜„ 😑 mute/unmute micophone
default: false
p.s. if you use webrtc, you can just use track.enabled = false to mute
async getAudioUriJS() πŸ˜„ πŸ˜„ get audio Uri path. this would be useful when you want to pass Uri into another module.
startRingtone(ringtone: string, ?vibrate_pattern: array, ?ios_category: string, ?seconds: number) πŸ˜„ πŸ˜„ play ringtone.
ringtone: 'DEFAULT' or 'BUNDLE'
vibrate_pattern: same as RN, but does not support repeat
ios_category: ios only, if you want to use specific audio category
seconds: android only, specify how long do you want to play rather than play once nor repeat. in sec.
stopRingtone() πŸ˜„ πŸ˜„ stop play ringtone if previous started via startRingtone()
stopRingback() πŸ˜„ πŸ˜„ stop play ringback if previous started via start()
setFlashOn(enable: ?boolean, brightness: ?number) 😑 πŸ˜„ set flash light on/off
async getIsWiredHeadsetPluggedIn() 😑 πŸ˜„ return wired headset plugged in state

Events

Event android ios description
'Proximity' πŸ˜„ πŸ˜„ proximity sensor detected changes.
data: {'isNear': boolean}
'WiredHeadset' πŸ˜„ πŸ˜„ fire when wired headset plug/unplug
data: {'isPlugged': boolean, 'hasMic': boolean, 'deviceName': string }
'NoisyAudio' πŸ˜„ 😑 see android doc.
data: null
'MediaButton' πŸ˜„ 😑 when external device controler pressed button. see android doc
data: {'eventText': string, 'eventCode': number }
'onAudioFocusChange' πŸ˜„ 😑 see android doc
data: {'eventText': string, 'eventCode': number }

NOTE: platform OS always has the final decision, so some toggle API may not work in some cases be careful when customizing your own behavior

LICENSE:

ISC License ( functionality equivalent to MIT License )

Original Author:

zxcpoiu

react-native-incall-manager's People

Contributors

1nspir3d avatar 8ballbombom avatar azamatjon avatar badver avatar blackneck avatar brunsy avatar bryant1410 avatar cristiantx avatar dmitriyilchenko avatar gordonhgraham avatar ianlin avatar javatutorials2016 avatar jjdp avatar kylekurz avatar lahsuk avatar lrorthmann avatar mahbbrah avatar masaori avatar novamaster-git avatar romick2005 avatar sagivo avatar santhoshvai avatar stepanvotava avatar stringsaeed avatar tsugitta avatar vladyslavkochetkov avatar waldyrious avatar whck6 avatar y00rb avatar zxcpoiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-incall-manager's Issues

InCallManager.stop() doesn't mute

I'm trying to mute current session using InCallManager.stop(); however, it deosn't mute the session. Can it be connected with the fact that I also use WebRTC?

Low audio volume only first time after fresh install

Hello,

I have a video conferencing app. When i open a fresh install for first time, its asking for permissions etc. After that, the first time the sound always comes out of the earpiece speaker. Next times it just comes from the external speakers like it's supposed to be. Does someone knows the cause of the bug? I have tried lots of things but didn't found a solution yet.

Joost

Add support for Xcode 9 with Swift version 3+

The library can not be converted by the new xcode 9 because it does not support swift version 2.x, just 3.x+.
Can we create a new branch with the old code and update master with the code in swift 3 or 4?

Can't build on iOS - RCTBridgeModule.h not found

Hello there. I'm trying to use this library, but I can't seem to set it up for iOS. I used react-native link and, while everything seems to be ok for Android, iOS didn't even build. I then followed all the installation steps, cleaned up, tried the steps again, and still nothing. Has anyone ever experienced this, or knows of a way to solve it? It's a detached ExpoKit project, so my guess is it has something to do with that. Thank you in advance!

demo screen ?

hi

anyone has a basic screen to provide as exemple ?

thanks

Problems setting up on IOS.

So i added the RNInCallManager to my xcodeproject. And moved forward to next step:
click your project's xcodeproject root, go to build setting and search Objective-C Bridging Header
But when i search Objective-C Bridging Header in my project build settings nothing shows up?

Has something changed?

Ring doesn't repeat

When I call InCallManager.start({ media: 'audio', ringback: '_DEFAULT_ }) I hear the ringback play once but then it doesn't repeat

Compile Errors RN 0.47.0

Since upgrading i'm getting these errors on compilation.

\node_modules\react-native-incall-manager\android\src\main\java\com\zxcpoiu\incallmanager\InCallManagerPackage.java:19: error: method does not override or implement a method from a supertype @Override ^ Note: \node_modules\react-native-incall-manager\android\src\main\java\com\zxcpoiu\incallmanager\InCallManagerModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: \node_modules\react-native-incall-manager\android\src\main\java\com\zxcpoiu\incallmanager\InCallManagerModule.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error :react-native-incall-manager:compileReleaseJavaWithJavac FAILED

Android issues with runtime

I have setup the android project with following in build.gradle and all build fine.

android {
....
defaultConfig {
...
targetSdkVersion 23
}

dependencies {
.....
compile 'com.android.support:support-v4:23.0.1'
.....
compile(project(':react-native-incall-manager')) {
exclude group: 'com.facebook.react', module: 'react-native'
}

.....
}

I get following auntie error:
Cannot read property 'checkRecordPermission' of undefined.

Looks like the project is not setup correctly and it is not able to resolve the incallmanager .

My build runs fine on iOS with no issues.

Don't automatically turn off screen on proximity in video mode

In video mode, I might very well want to touch the screen to interact during a call, particularly as it isn't near my ear. Therefore, I would suggest that the default behavior not turn off the screen on proximity in video mode. During audio mode is fine, or maybe better, when audio is through the earpiece and not the speaker. I could see using an audio call in speaker mode but being unable to because the default behavior kills the screen. I hit this behavior trying to activate a control I'd placed to toggle speaker mode. :)

Thanks!

undefined is not an object _InCallManager.start

I'm trying to install this for android and it's not working. All I did was

  1. npm install
  2. import InCallManager from 'react-native-incall-manager';
  3. InCallManager.start()

And I am getting the error: undefined is not an object (evaluating '_InCallManager.start')

Not using speakerphone for video call

On my iPhone 6 I've started the call with InCallManager.start({ media: 'video' }) but it uses the earpiece. On an iPhone 7 it correctly uses the speakerphone, though

[WIP] Refactor and Rewrite

This library might need a whole rewrite.

reason:

Android

AppRTC's contains audio manager which supports Bluetooth and do similar things like in this module.
We Can extends it for the core routing function and update it along with it's version.

iOS

  • swift might not suitable for react native as a sdk/framework due to the bridging header.
  • swift seems bring more pains than it was intended to be.
  • webrtc handles audio routing in iOS internally already, I don't know why.

InCallManager.stop() raises iOS errors about deactivating audio session with active I/O

Seems that because of this, audio doesnt work on any subsequent call.

2017-06-27 22:01:27.901167-0400 [avas] AVAudioSession.mm:1049:-[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
2017-06-27 22:01:27.901411-0400 RNInCallManager.stop: audioSession.setActive(false, withOptions: Optional(__C.AVAudioSessionSetActiveOptions(rawValue: 1))) failed: Error Domain=NSOSStatusErrorDomain Code=560030580 "(null)"

2017-06-27 22:01:27.901480-0400 RNInCallManager.setKeepScreenOn(): enable: false
2017-06-27 22:01:27.914956-0400 RNInCallManager.startAudioSessionNotification() stopping...
2017-06-27 22:01:27.915047-0400 RNInCallManager.stopAudioSessionInterruptionNotification()
2017-06-27 22:01:27.915130-0400 RNInCallManager.stopAudioSessionRouteChangeNotification()
2017-06-27 22:01:27.915190-0400 RNInCallManager.stopAudioSessionMediaServicesWereLostNotification()
2017-06-27 22:01:27.943753-0400 RNInCallManager.stopAudioSessionMediaServicesWereResetNotification()
2017-06-27 22:01:27.943835-0400 RNInCallManager.stopAudioSessionSilenceSecondaryAudioHintNotification()
2017-06-27 22:01:27.950228-0400 RNInCallManager.AudioRouteChange.Reason: RouteConfigurationChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVideoChat
2017-06-27 22:01:27.950328-0400 RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: cound not resolve notification
2017-06-27 22:01:27.959986-0400 RNInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVideoChat
2017-06-27 22:01:27.960205-0400 RNInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=0 media=video category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVideoChat
2017-06-27 22:01:27.962438-0400 RNInCallManager.updateAudioRoute(): audioSession.overrideOutputAudioPort(.None) success
2017-06-27 22:01:27.963160-0400 RNInCallManager.updateAudioRoute() did NOT change audio mode
2017-06-27 22:01:27.963218-0400 RNInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: cound not resolve notification

App crashing when connecting to/disconnecting from bluetooth headset during call

We use this module in combination with react-native-webrtc. Everything seems to be fine except connecting to or disconnecting from a bluetooth headset during an active call. All I get is the following exception in XCode:

#
# Fatal error in ../../../webrtc/modules/audio_device/audio_device_buffer.cc, line 242
# last system error: 0
# Check failed: num_samples == rec_samples_per_10ms_ (160 vs. 480)
# 
#
(lldb) 

This might also be related to this issue from react-native-webrtc.

App in background and green "In Call" bar on iOS

Does this library handle this? When you leave facetime and you're still in a call there's the green bar at the top of the UI that lets you know a call is happening in the background.

If not, does anyone have any ideas on how to handle that?

[Question] event MediaButton

I tried to capture event "MediaButton" but it does not do anything.

componentWillMount(){
DeviceEventEmitter.addListener('MediaButton',(ev) => {
console.log('MediaButton',ev)
})
}

Could you tell me how to use it properly?

Get Swift Compiler Error when installing incall-manager on ios

I followed every single step on installation.

1, npm install react-native-incall-manager
2, react-native link react-native-incall-manager for android
3, In xcode, right click on your_project directory, add files to your project and add node_modules/react-native-incall-manager/ios/RNInCallManager/
4, Edit -> Convert -> To Current Swift Syntax To swift 3
5, Objective-C Bridging Header to ../node_modules/react-native-incall-manager/ios/RNInCallManager/RNInCallManager-Bridging-Header.h

And I finally ended up with these errors. This might caused by xcode not found the OC bridging header.
image

I was wondering is there anyone has the problem?

setForceSpeakerphoneOn not working on Android

Using version 1.0.1. Steps to reproduce:

  1. Set up a default video call where the speakerphone is on and audio is being transmitted.
  2. Call InCallManager.setForceSpeakerphoneOn(false).

On my phone this seems to have no effect. I'd expect this to turn off the speaker so audio is going through the phone speaker.

Thanks for the quick turnaround, 1.0.1 is working very nicely with regard to the issues I filed earlier!

Flash API

I'd like to see an API for determining availability of, as well as toggling, camera flash. I suggest the following:

isFlashAvailable(): Returns true if the available hardware supports a flash.
setFlashEnabled(bool): Sets the flash on or off.

Installation: issue when adding RNInCallManager and looking at Objective-C Bridging header

I'm trying to follow the instructions to get this library working in my react-native project, for ios, and am having major trouble:

Add files in to your project:

Open your project in xcode
find your_project directory under your project's xcodeproject root. ( it's a sub-directoory, not root xcodeproject itself )
you can do either:
directly drag your node_modules/react-native-incall-manager/ios/RNInCallManager/ into it.
right click on your_project directory, add files to your project and add node_modules/react-native-incall-manager/ios/RNInCallManager/
on the pou-up window, uncheck Copy items if needed and select Added folders: Create groups then add it. you will see a new directory named RNInCallmanager under your_project directory.
Setup Objective-C Bridging Header:

click your project's xcodeproject root, go to build setting and search Objective-C Bridging Header
set you header location, the default path is: ReactNativeProjectRoot/ios/, in this case, you should set ../node_modules/react-native-incall-manager/ios/RNInCallManager/RNInCallManager-Bridging-Header.h

This is what the directory structure looks like in xcode:

myProject
-- webRTC.framework
-- RCTWebRTC.xcodeproj
-- myProject
-- Libraries
-- voicewrtcTests
-- Products
-- Frameworks

I need to add RNInCallManager to myProject/myProject, correct?
When I do I don't get the pop-up window where I can uncheck "Copy items if needed" and select "Added folders: Create Groups".

**When I look at the build settings on myProject root directory, I do not see Objective-C Bridging Header anywhere, it's not there (I can search for it with empty results) **

How can I proceed to install this?

Ringback issue

In iOS device ringback is not played? but in simulator is working , what I am missing?

InCallManager.start({media: 'audio', ringback: '_BUNDLE_'});

I also try _DEFAULT_and _DTMF_

In simulator every thing is ok but in device ringback and busy tone is not played , just ringtone is working

Volume on iPhone 7 not controllable

Did someone experience the strange behavior on an iPhone 7 when changing the volume up and down? It just stays on the loudest possible volume and doesn’t go down. But when plugging in earphones, the sound is controllable.

Failed to convert RNIncallManager.swift

When I try to implement react-native-incall-manager into my iOS project, it requires converting swift version. And the Xcode converting failed to convert RNIncallManager.swift.
image
I tried to discard the change and it seems okay (It successfully builds the app).

I raise this issue because I don't know if I'm doing right.
Is there a better way to solve this problem or its bug needs to fix in the code?

Thanks.

bridging header does not exist

I am using react native 0.38 and react-native-incall-manager 1.5.4
I am using Xcode 7.3.1 (Swift 2.2)
I have followed the steps as mentioned in the docs

but i am still getting error bridging header does not exist
screen shot 2017-07-25 at 10 17 45 pm
screen shot 2017-07-25 at 10 19 30 pm

please check the screen shots

Get speakerphone state

Currently it is not possible to find out speakerphone state. Since speakerphone can be turned on/off by both system and API, it is hard to show user the correct speakerphone state (e.g. for speakerphone icon). It would be great to have an event which would be fired when speakerphone is turned on or off.

[Feature request] Proximity detector api

Hello and thanx for this great plugin !

I have an issue caused on my WebRTC negociation if the screen go black with proximity sensor on Android.

My quickfix was to use video mode with ringback and setForceSpeakerphoneOn to false to have a ringback before webrtc negotiation.
As the proximity sensor is enabled when the sound is routed to earpiece anyway since last version. I would need to be able to disable it.

So are you ok if i make a pull request to add this API? (simply make startProximitySensor and stopProximitySensor public and linked to react native)

turnScreenOn not working

maybe i'm missing something.. but calling InCallManager.turnScreenOn() doesn't seem to actually do anything

i'm on these versions:
"react-native-incall-manager": "2.1.0",
"react-native": "0.42.0-rc.3",

Proximity Iphone SE

Hello, Proximity does not work on IPhone SE with OS 11.

  • On other devices (either from apple or android) works as expected
  • Proximity for this specific iphone works when doing normal call from telephone.

Freeze's timers on Samsung devices when proximity is near?

The following code correctly works on a lot of devices:

import React, { Component } from 'react'
import {
  AppRegistry,
  Text,
} from 'react-native'
import InCallManager from "react-native-incall-manager"

export default class Intervals extends Component {

  componentDidMount = () => {
    InCallManager.start({media: 'audio'})
    this.interval = setInterval(() => {
      console.log("tick!")
    }, 1000)
  }

  render() {
    return (
      <Text>Intervals</Text>
    )
  }
}

AppRegistry.registerComponent('Intervaler', () => Intervals)

But at a Samsung device, the interval stopped when proximity is near and turn off screen. Any ideas why does it happen?
Thanks

recordPermission and requestRecordPermission on iOS

Bridging those to Javascript will be good.

[[AVAudioSession sharedInstance] recordPermission];
// And
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
}];

I will send a PR if I have time to do it.

'checkRecordPermission' of undefined and 'checkCameraPermission' of undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.