pkhien95 / react-native-caller-id Goto Github PK
View Code? Open in Web Editor NEWReact Native Caller ID module
License: MIT License
React Native Caller ID module
License: MIT License
Just leaving this to save anyone from spending tons of time wondering why this doesn't work for iOS.
The code as currently written hasn't ever been run successfully on iOS, there are several problems, here are a few of the key ones:
-Data group is inconsistent between app and extension: https://github.com/hienphung/react-native-caller-id/blob/eda5385dde9f3b837ab956b6ea3d3de4da23b4a6/ios/CallerIDExtension/CallDirectoryHandler.m#L12
-Dict key is inconsistent between rn and ios:
https://github.com/hienphung/react-native-caller-id/blob/eda5385dde9f3b837ab956b6ea3d3de4da23b4a6/ios/CallerIDExtension/CallDirectoryHandler.m#L24
-Inconsistent use of the callers list (uses it as a list of numbers in one place, and a list of lists of numbers in another) https://github.com/hienphung/react-native-caller-id/blob/eda5385dde9f3b837ab956b6ea3d3de4da23b4a6/ios/CallerIDExtension/CallDirectoryHandler.m#L61
-Incorrect conversion to unsignedLongLong:
https://github.com/hienphung/react-native-caller-id/blob/eda5385dde9f3b837ab956b6ea3d3de4da23b4a6/ios/CallerIDExtension/CallDirectoryHandler.m#L77
-You have to add app capabilities for app groups in order to communicate between the main application and the call directory extension, read more about this here: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups
There may be a couple I forgot, but I'd recommend reading a native modules tutorial + CallKit calldirectory tutorial and going from scratch, it's a pretty minimal module to create.
Also, not related to this library, but if you get the error "error:Error Domain=com.apple.CallKit.error.calldirectorymanager Code=3" from iOS, official resources say this means you passed the phone numbers unsorted, but there is some undocumented behavior where you will also get this error if any of the numbers are the wrong length for their area code.
I'd highly recommend attaching a debugger to your extension itself (separate process, not the main app) in xcode if you're having trouble getting this to work.
Hi, did anyone make this thing work as described?
Has anyone have successfully applied this package and got in working?
I followed install instructions and the package does not seem to be working correctly.
The interesting thing is this error is not from the original CallerId.getExtensionEnabledStatus()
but from the catch()
error
CallerId.getExtensionEnabledStatus().then(enabled => {
return CallerId.setCallerList(callers);
}).then(res => {
console.log('setCallerList', res)
}).catch(err => {
console.log('err?.message || err);
});
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.