Comments (8)
i created one here : https://github.com/Sunny41/contactsx-example
it has a simple button on the homepage and the same code I posted above in the chooseContact() method :)
from cordova-plugin-contacts-x.
Please post the full code which is related to this including the pick method and stuff
from cordova-plugin-contacts-x.
import ContactsX from 'cordova-plugin-contacts-x'
...
ContactsX.requestPermission(function (success) {
ContactsX.pick(function (contact) {
console.log(success);
console.log(contact);
console.log(contact.firstName);
const contactInfo = contact;
console.log(contactInfo);
this.name = contactInfo.firstName;
...
}, function (error) {
console.log(error);
});
}, function (error) {
console.log(error);
});
}```
from cordova-plugin-contacts-x.
So the error happens here: this.name = contactInfo.firstName;
?
But the line before is printing the contact correctly with firstName
?
from cordova-plugin-contacts-x.
exactly :)
I tried to do that without using a new variable and the same error occurs...
tried that with ios 12 on an iphone 5 and with the simulator of an iphone 12 with ios 14
from cordova-plugin-contacts-x.
That doesn't make sense 🤯 pls create a small reproducable repo
from cordova-plugin-contacts-x.
Hi there again,
I tested it on the android emulator with pixel XL and on my physical device samsung galaxy s10 with android 11.
cordova.js:314 Uncaught TypeError: Cannot set property 'name' of null at main.js:6755 at Object.callbackFromNative (cordova.js:295) at <anonymous>:1:9
from cordova-plugin-contacts-x.
Hey there. Sorry for the late response.
I just checkout your Repo. The problem is not that firstName
is null, the problem is that there is no variable name
, so this.name
can't work.
And even if there was a class variable called name it may not work. Please read this: https://logicmason.com/2019/how-to-access-this-from-inside-a-callback/
from cordova-plugin-contacts-x.
Related Issues (20)
- (bug): iOS - Phone "type" is always "_$!<Other>!$_" HOT 10
- (bug) Ionic Android requestPermission throws "Cannot read property 'apply' of undefined" HOT 4
- (feat): To load photos? HOT 5
- when we chage permission from phone settings page in androind and ios HOT 1
- (bug): Phone number not saved (Android 11) HOT 2
- (bug): contact access permission cannot be seen in iPhone settings/app own permission HOT 8
- (feat):
- Issue calling from window
- (bug): App runs fine on device from CLI, but crashes upon launch if installed from PlayStore. HOT 8
- (bug): Error updating plugin version 2.0.3 -> 2.1.0 HOT 1
- "organizationName" and "baseCountryCode" are missing in typescript interfaces HOT 1
- (bug): .ipa file size increased for PROD build
- scope not access inside function results to find contacts (bug): HOT 1
- Issues migrating app to new cordova/angular versions HOT 1
- (bug): Gradle compile() configuration is now obsolete HOT 1
- (feat): Filter parameter in find function
- (bug): compileSdkVersion is not specified. Please add it to build.gradle
- Contact picker api
- Pick multiple contacts
- How to request permission again if user denies it first time?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-contacts-x.