回答
根据Mozilla的app permissions page,有一个名为“phonenumberservice”的权限,但没有关于它的任何信息。无论如何,Permision已列在“内部(已认证)应用程序权限”下,这意味着只有“系统级应用程序和由Mozilla/operators/OEMs创建的默认应用程序”才能使用它。
谢谢。这意味着我无法获得电话号码! :( – 2014-12-06 17:02:07
与Firefox 2.0,你应该能够使用移动识别API: https://wiki.mozilla.org/WebAPI/MobileIdentity https://bugzilla.mozilla.org/show_bug.cgi?id=1021594 我相信权限是:
“权限”:{ “mobileid”:{}}
它是特权。
所以,@Jason说,移动标识API提供了这种能力,而不是只为认证,但特权应用。所以它不再仅限于OEM。
的Mozilla Wiki网站显示的API:
dictionary MobileIdOptions {
boolean forceSelection = false;
};
partial interface Navigator {
Promise getMobileIdAssertion(optional MobileIdOptions options);
};
该网站还为此提供了一个示例代码框架:
function verifyAssertion(aAssertion) {
// Make use of the remote verification API
// and return the verified msisdn.
// NB: This is necessary to make sure that the user *really* controls this phone number!
}
// Request a mobile identity assertion and force the chrome UI to
// allow the user to change a possible previous selection.
navigator.getMobileIdAssertion({ forceSelection: true })
.then(
(assertion) => {
verifyAssertion(assertion)
.then(
(msisdn) => {
// Do stuff with the msisdn.
}
);
},
(error) {
// Process error.
};
);
对于这个工作,你需要添加mobileid
许可的清单文件,例如像这样(我做了说明):
"permissions": {
"mobileid": {
"description": "Required for sending SMS for two factor authentication",
"access": "readonly"
}
}
PS:我提出了这个答案,因为大多数答案都是过时的,而不是那个答案,并不包含所有有用的信息。
参考文献:
我知道这个答案是几年前,但我想知道:verifyAssertion应该做些什么?联系MSISDN验证服务器? – nuno 2017-03-09 09:43:35
- 1. 在wordpress中获取当前用户的电话号码
- 2. 获取电话号码
- 3. 获取Prestashop 1.6中的电话号码
- 4. 如何获取Facebook用户地址和用户电话号码?
- 5. 使用Firebase从C++获取用户的电话号码
- 6. 从电话号码获取区号
- 7. Palm WebOS - 如何获取用户的电话号码?
- 8. 如何获取用户的电话号码?
- 9. 获取Facebook用户的电话号码和详细信息
- 10. 统一和ios - 获取用户的电话号码
- 11. Facebook API - 如何获取用户的地址,电话号码?
- 12. 获取BlackBerry设备的电话号码
- 13. 获取设备的电话号码
- 14. 如何获取我的电话号码
- 15. 获取Android设备的电话号码
- 16. preg_match_all获取电话号码的模式
- 17. Firebase函数获取用户电话号码
- 18. Adobe Flex获取用户电话号码
- 19. 如何在android代码中获取手机的电话号码?
- 20. 从查找URI获取电话号码
- 21. 获取传入电话号码
- 22. 从android手机获取电话号码
- 23. 电话列表 - 获取每个人的电话号码
- 24. 如何获取电话号码?
- 25. 获取联系电话号码
- 26. 改善时间获取电话号码
- 27. 如何获取LDAP电话号码?
- 28. 如何获取星号中的电话号码(callerID)
- 29. 生成从用户的电话号码
- 30. 如何使用javascript在电话号码中获取特定号码
以下这个问题... – Rubyrider 2014-12-08 13:53:26