You can not have access to the phone number without being a certified
application, which 3rd party applications currently are not allowed to be.
https://wiki.mozilla.org/WebAPI/Security/MobileConnection
Lucas.
On Mar 25, 2013, at 2:33 AM, Mar wrote:
> Thanks you very much!
> This code is just what I need.
> I'm working in a lifestyle app for MNOs, and I need the phone number to
> confirm the user identity.
>
> I added this code for trying:
> var mobileConnection = getMobileConnection();
> if (!mobileConnection)
> return;
>
> var info = mobileConnection.iccInfo;
> console.log("____________"+ info.iccid);
> console.log("____________"+ info.msisdn);
>
> var req = mobileConnection.sendMMI('*#06#');
> req.onsuccess = function getIMEI() {
> console.log("____________"+req.result);
> };
>
> And it return this error:
> E/GeckoConsole(669): [JavaScript Error: "ReferenceError:
> getMobileConnection is not defined"
>
> Do I need to add anything at manifest? Do I need to import anything? What's
> wrong? Any idea?
> Besides that if I go to settings and select device information, at phone
> number does not appear, but the phone has a SIM card inside.
> Could be related?
>
> Thanks
> Regards
_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps