wumke / react-native-immediate-phone-call Goto Github PK
View Code? Open in Web Editor NEWInitiate immediate phone call (without further user interaction) for React Native on iOS and Android.
License: GNU General Public License v3.0
Initiate immediate phone call (without further user interaction) for React Native on iOS and Android.
License: GNU General Public License v3.0
I am getting the following error when I run gradle assembleRelease
:
> Task :react-native-immediate-phone-call:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-immediate-phone-call:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2734: error: resource android:attr/fontStyle not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2735: error: resource android:attr/font not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2736: error: resource android:attr/fontWeight not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2737: error: resource android:attr/fontVariationSettings not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2738: error: resource android:attr/ttcIndex not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2902: error: resource android:attr/startX not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2905: error: resource android:attr/startY not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2908: error: resource android:attr/endX not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2911: error: resource android:attr/endY not found.
/Users/danale/Projects/NFIBEngage/node_modules/react-native-immediate-phone-call/android/build/intermediates/res/merged/release/values/values.xml:2919: error: resource android:attr/offset not found.
error: failed linking references.
react-native-immediate-phone-call
is definitely linked, but I am not sure if I am wiring up the configuration wrong inside of android/app/src/java/com/nfibengage/MainApplication.java
. This is what I have without having done anything to the file:
package com.nfibengage;
import android.app.Application;
import android.util.Log;
import com.facebook.react.PackageList;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import com.github.wumke.RNImmediatePhoneCall.RNImmediatePhoneCallPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.microsoft.appcenter.reactnative.crashes.AppCenterReactNativeCrashesPackage;
import com.microsoft.appcenter.reactnative.analytics.AppCenterReactNativeAnalyticsPackage;
import com.microsoft.appcenter.reactnative.appcenter.AppCenterReactNativePackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
However, your documentation shows this:
import com.github.wumke.RNImmediatePhoneCall.RNImmediatePhoneCallPackage;
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
...
new RNImmediatePhoneCallPackage(),
...
);
}
...
Can someone confirm if indeed I am looking in the right place for the problem?
Hi, would it possible (in theory) to add more options to the call? I am thinking specifically about activating the loudspeaker by default.
Thanks,
Amadeus
Is it possible to put the call screen in the background after starting the call?
Thanks.
Hello,
Can you please point me to what I am doing wrong? I recently made the decision to switch from react-native-phone-call
to this package so numbers can be dialed directly from app without going to dialer but app breaks with no additional error message.
Here is a sample of my code;
...
import RNImmediatePhoneCall from 'react-native-immediate-phone-call';
testCall = () => {
RNImmediatePhoneCall.immediatePhoneCall("0123456789");
}
render() {
return (
<Button
large={true}
backgroundColor="#fec33a"
color="#000000"
onPress={this.testCall}
title="Submit"
/>
);
}
}
Here is the response that is returned from my logs
11-08 18:17:34.941 27667 27667 D ReactNative: ReactInstanceManager.detachViewFromInstance()
for typescript
Example:
RNImmediatePhoneCall.immediatePhoneCall(phone).catch(console.error)
but catch doesnt work
thanks
Hello, tried out this package and I followed every step from the README.
import React from 'react';
import RNImmediatePhoneCall from 'react-native-immediate-phone-call';
import { Button } from 'react-native';
...........
const testCall = () => {
RNImmediatePhoneCall.immediatePhoneCall("08107804084");
}
.......
After clicking on this button, nothing happens and I tried logging out if there was any error but nothing shows as the output as well..
Hello,
thanks for this repo!
When i start a new call on my phone is using Skype as default app.
Can i use the "default" Phone app?
Ask permission for phone call shows up on iOS, but I have to setting it manually on Android (settings, apps, myApp, permission)
is there more steps I need to do to shows up the ask permission dialog ?
Hi I want to do an immediate phone call when firebase data-message notification comes and application is in background.
In index.js I have
messaging().setBackgroundMessageHandler(async remoteMessage => {
await RNImmediatePhoneCall.immediatePhoneCall(remoteMessage.data?.phone);
});
When my application is in background mode the code above works on iOS phone and andorid simulator, but not on real Android phone (android version 10.*)
There is not any error, the startActivity for Intent.ACTION_CALL is called.
When I have application in foreground and message comes the immediate call works (iOS and Android phone)
return messaging().onMessage(async remoteMessage => {
await RNImmediatePhoneCall.immediatePhoneCall(remoteMessage.data?.phone);
});
Any idea how to solved it? Thanks
"react": "^17.0.2",
"react-native": "0.66.0",
"react-native-immediate-phone-call": "^2.0.0",
Hi,
I'm having a problem while trying to generate APK. Someone help me?
LOG
Task :react-native-immediate-phone-call:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-immediate-phone-call:verifyReleaseResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values-v26\values-v26.xml:7: error: resource android:attr/colorError not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values-v26\values-v26.xml:11: error: resource android:attr/colorError not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values-v26\values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2711: error: resource android:attr/fontStyle not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2712: error: resource android:attr/font not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2713: error: resource android:attr/fontWeight not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2714: error: resource android:attr/fontVariationSettings not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2715: error: resource android:attr/ttcIndex not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2796: error: resource android:attr/startX not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2799: error: resource android:attr/startY not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2802: error: resource android:attr/endX not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2805: error: resource android:attr/endY not found.
C:\Users\MyUser\Documents\MobileApps\InterfonneApp\node_modules\react-native-immediate-phone-call\android\build\intermediates\res\merged\release\values\values.xml:2813: error: resource android:attr/offset not found.
error: failed linking references.
[email protected]
react-native info:
Environment:
OS: macOS Sierra 10.12.6
Node: 8.9.4
Yarn: Not Found
npm: 5.8.0
Watchman: Not Found
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.2 => 0.55.2
It behaves like Simple react native Linking call.
I need to call immediately, how can it be possible?
Hello, I have this bug on android sdk 27 with react-native 0.57
Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxx flg=0x10000000 cmp=com.android.server.telecom/.components.UserCallActivity } from ProcessRecord{c5b7094 24276:com.alertesecours/u0a84} (pid=24276, uid=10084) with revoked permission android.permission.CALL_PHONE
readException
Parcel.java:1684
readException
Parcel.java:1637
startActivity
ActivityManagerNative.java:3101
execStartActivity
Instrumentation.java:1518
startActivity
ContextImpl.java:791
startActivity
ContextImpl.java:768
startActivity
ContextWrapper.java:356
startActivity
ContextWrapper.java:356
immediatePhoneCall
RNImmediatePhoneCallModule.java:40
invoke
Method.java
invoke
JavaMethodWrapper.java:372
invoke
JavaModuleWrapper.java:160
run
NativeRunnable.java
handleCallback
Handler.java:751
dispatchMessage
Handler.java:95
dispatchMessage
MessageQueueThreadHandler.java:29
loop
Looper.java:154
run
MessageQueueThreadImpl.java:192
run
Thread.java:761
this article https://stackoverflow.com/questions/33473436/revoked-permission-android-permission-call-phone/33473478 seem to tell us the way to solve it, but I wondered if we can't include it directly in react-native-immediate-phone-call
there is no onRequestPermissionsResult() method in android build when flowing the example in README file (MainActivity.java):
import com.github.wumke.RNImmediatePhoneCall.RNImmediatePhoneCallPackage; // <--- import
...
public class MainActivity extends ReactActivity {
...
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
RNImmediatePhoneCallPackage.onRequestPermissionsResult(requestCode, permissions, grantResults); // this line fails as 'onRequestPermissionsResult' does not exist
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
...
}
Hope Im not missing anything but as expected this fail the build, if the state line is commented then crash on trying to use library from the JS side with error about permission (also expected)
any resolution for this? maybe only README file is not updated?
using:
v1.0.0
RN v0.55.3
Hi,
I have one problem in Android after call i canceled. I do not get back my application but last opened application before my application was opened. Do you have a idea how to fix it?
Example:
Thank you.
Task :app:compileDebugJavaWithJavac FAILED
D:\ReactNativeProjects\phonecall\phonecall\android\app\src\main\java\com\phonecall\MainActivity.java:13: error: cannot find symbol
RNImmediatePhoneCallPackage.onRequestPermissionsResult(requestCode, permissions, grantResults); ^
it does not work with new version of react native with auto linking and pods. Are you gonna support this repository or is it dead?
Would it be possible to update the version in the npm repo
After manual installation and trying to run react-native run-ios
build failes with error:
** BUILD FAILED ** The following build commands failed: CompileC /Users/michalpawlowski/Library/Developer/Xcode/DerivedData/MenuManager-dhwvpfsdgqkknsdamgvddtqaipyh/Build/Intermediates.noindex/RNImmediatePhoneCall.build/Debug-iphonesimulator/RNImmediatePhoneCall.build/Objects-normal/arm64/RNImmediatePhoneCall.o /Users/michalpawlowski/Documents/GitHub/manager-app/ManagerApp/node_modules/react-native-immediate-phone-call/ios/RNImmediatePhoneCall/RNImmediatePhoneCall.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNImmediatePhoneCall' from project 'RNImmediatePhoneCall') (1 failure)
I'm using Mac M1, React Native version 0.71, XCode 14.2.
Could be a problem with XCode, because Android build still works fine :)
I want to use a Video call in my app with the phone number I did not see anything why which I can do that.
Hello!
I searched a lot on GitHub and StackOverflow regarding this issue, but I still didn't manage to get an answer. The closest I could get was finding this issue: https://github.com/wumke/react-native-immediate-phone-call/issues/11?fbclid=IwAR1_MFthP1g28L_kAJqFyy9xkuyonCHFDkoNTaTnjKWwC8HY__PjGAxS7sg
What actually happens: I am using Expo SKD 36, which is based on React Native 0.61.4. After I added the dependency to react-native-immediate-phone-call library, by using:
npm install react-native-immediate-phone-call --save
react-native link react-native-immediate-phone-call
I only manage to get this error:
null is not an object ...evaluating '_reactNative.NativeModules.RNImmediatePhoneCall.immediatePhoneCall
Did anyone managed to make this library work with Expo? Any help would be very much appreciated.
Thanks a lot!
Attached an image with the logs: https://ibb.co/6ZvW6Cf
Hi,
I installed and linked the module successfully on iOS, but when I call RNImmediatePhoneCall.immediatePhoneCall() with some phone number, nothing happens.
What could be the reason? Do I need to explicitly check and request permission to make a phone call? Do I need to modify some other native files as well? Is it because I'm using a simulator?
Any help would be appreciated, thanks
In RN 0.47 createJSModules is deprecated
Hi,
In the app (chatting app) that I creating i have calling option. This calling must be initiated to particular user based on the room id. Is it possible with this package. If yes can you provide a sample demo in usage
getting this error whenever I call RNImmediatePhoneCall.immediatePhoneCall:
undefined is not an object (evaluating '_reactNative.NativeModules.RNImmediatePhoneCall.immediatePhoneCall')
Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-23 Android SDK Platform 23
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: C:\Users\ANIL\AppData\Local\Android\Sdk
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
Hi,
Before everything, I'd like to thank you for the effort you've put in building this module.
Also, I've already read the previous issue with this same error but I don't see a solution to my problem since from what the other user said, Instead of using RNImmediatePhoneCallModule he used RNImmediatePhoneCallPackage, however I've followed the readme and it says to use RNImmediatePhoneCallPackage.
I've double checked the installation process and I have everything similar with your readme.
This is the error I'm getting
../MainActivity.java:45: error: cannot find symbol
RNImmediatePhoneCallPackage.onRequestPermissionsResult(requestCode, permissions, grantResults); // very important event callback
symbol: method onRequestPermissionsResult(int,String[],int[])
location: class RNImmediatePhoneCallPackage
Note: .../MainApplication.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
I'm using react-native 0.59.10
Am I missing something? How could I solve this issue?
Thank you
Hi guy!
i just use react-native-immediate-phone-call (RNIC) for 3 months. After a phone call, my app will send a network request to save info about the call on the server, But my users usually (about 30%) get Network error like this image below. Before using RNIC , i just used Linking of expo and almost requests are called OK.
please let me know whether RNIC could block network when make a call. If that how can i keep the network stable through the call
Thank you.
I want's to hide phone number when calling to any number for my customer because my customer are taxi driver and they can call to the passenger but i want's the taxi driver can not see the passenger phone number when calling to that, is it possible ?
I installed the library in the "easy way", and double check that settings.gradle and build.gradle are ok with you suggest. Error:
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-immediate-phone-call'.
> Could not resolve all dependencies for configuration ':react-native-immediate-phone-call:_debugPublishCopy'.
> Could not find com.android.support:appcompat-v7:27.1.1.
Searched in the following locations:
file:/Users/javiergomez/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/javiergomez/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/javiergomez/Dev/eyios6/android/sdk-manager/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
Required by:
eyios6:react-native-immediate-phone-call:unspecified > com.facebook.react:react-native:0.57.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.