mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Change JS to call navigator.contacts instead of navigator.ContactManager, which no longer exists.
This commit is contained in:
parent
705b8f6874
commit
5cd25316fa
@ -256,14 +256,14 @@ public class ContactManager implements Plugin {
|
||||
|
||||
// Code for backwards compatibility with the OLD Contacts API
|
||||
if (all) {
|
||||
this.ctx.sendJavascript("navigator.ContactManager.droidAddContact('" + name + "','" + phoneNumber + "','" + email +"');");
|
||||
this.ctx.sendJavascript("navigator.contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"');");
|
||||
}
|
||||
else {
|
||||
this.ctx.sendJavascript("navigator.contacts.droidFoundContact('" + name + "','" + phoneNumber + "','" + email +"');");
|
||||
}
|
||||
} while (cur.moveToNext());
|
||||
if (all) {
|
||||
this.ctx.sendJavascript("navigator.ContactManager.droidDone();");
|
||||
this.ctx.sendJavascript("navigator.contacts.droidDone();");
|
||||
}
|
||||
else {
|
||||
this.ctx.sendJavascript("navigator.contacts.droidDone();");
|
||||
@ -272,7 +272,7 @@ public class ContactManager implements Plugin {
|
||||
else
|
||||
{
|
||||
if (all) {
|
||||
this.ctx.sendJavascript("navigator.ContactManager.fail();");
|
||||
this.ctx.sendJavascript("navigator.contacts.fail('Error');");
|
||||
}
|
||||
else {
|
||||
this.ctx.sendJavascript("navigator.contacts.fail('None found!');");
|
||||
@ -299,7 +299,7 @@ public class ContactManager implements Plugin {
|
||||
if(data != null)
|
||||
{
|
||||
data.email = email;
|
||||
this.ctx.sendJavascript("navigator.Contacts.droidFoundContact('" + data.name + "','" + data.phone + "','" + data.email +"');");
|
||||
this.ctx.sendJavascript("navigator.contacts.droidFoundContact('" + data.name + "','" + data.phone + "','" + data.email +"');");
|
||||
}
|
||||
} while (cur.moveToNext());
|
||||
this.ctx.sendJavascript("navigator.contacts.droidDoneContacts();");
|
||||
|
Loading…
Reference in New Issue
Block a user