I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
Current behavior:
Running ionic cordova plugin add cordova-plugin-uid actually installs a plugin called cordova-plugin-dreamover-uid.
Any attempts to access the Uid plugin's properties result in the following error:
Native: tried calling Uid.IMEI, but the Uid plugin is not installed.
Install the Uid plugin: 'ionic cordova plugin add cordova-plugin-uid'
Expected behavior:
Running ionic cordova plugin add cordova-plugin-uid installs cordova-plugin-uid.
Steps to reproduce:
Follow instructions from https://ionicframework.com/docs/native/uid
Other information:
Considering this pull request has been outstanding for almost a year, it may be time to consider lionelhe/cordova-plugin-uid abandoned and switch to txlopes/cordova-plugin-uid instead.
@jimlerza
How do i install plugin from _txlopes/cordova-plugin-uid_ in ionic 5 project
tried with
ionic cordova plugin add https://github.com/ivanchaz/cordova-plugin-uid
getting below error
cordova.cmd plugin add http://github.com/ivanchaz/cordova-plugin-uid
Failed to fetch plugin http://github.com/ivanchaz/cordova-plugin-uid via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! Error while executing:
npm ERR! C:Program FilesGitcmdgit.EXE ls-remote -h -t ssh://[email protected]/ivanchaz/cordova-plugin-uid.git
npm ERR!
npm ERR! Warning: Permanently added the RSA host key for IP address '13.234.210.38' to the list of known hosts.
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:Usersnilesh.bandekarAppDataRoamingnpm-cache_logs2020-04-08T13_26_20_386Z-debug.log
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd plugin add http://github.com/ivanchaz/cordova-plugin-uid exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
There are 3 ways to make the Native Uid plugin usable:
a. lionelhe merges PR #1 into lionelhe/cordova-plugin-uid master
b. kuroshiropanda pushes a new version of cordova-plugin-uid to NPM, now based on lionelhe/cordova-plugin-uid 1.3.1
a. kuroshiropanda changes the 'repository' of cordova-plugin-uid on NPM to point to txlopes/cordova-plugin-uid
b. kuroshiropanda pushes a new version of cordova-plugin-uid to NPM, now based on txlopes/cordova-plugin-uid 1.3.1
c. The ionic native team updates the Ionic Native Uid plugin's repo configuration to reference txlopes/cordova-plugin-uid
3.
a. The ionic native team creates a new NPM package with a new, non-conflicting name, and bases it on txlopes/cordova-plugin-uid (or ideally some other repo _with an active maintainer_)
b. The ionic native team updates the Ionic Native Uid plugin's repo configuration to reference this new, actively maintained version of cordova-plugin-uid
Only the third is within the Ionic Native team's control. I don't believe it's possible to contact NPM package maintainers, and lionelhe/cordova-plugin-uid is likely abandoned, so it's also the only viable solution.
Hi @jimlerza do you think this plugin will work now..
I just went through the documentation. https://developer.android.com/about/versions/10/privacy/changes#non-resettable-device-ids
If your app doesn't have the permission and you try asking for information about non-resettable identifiers anyway, the platform's response varies based on target SDK version:
If your app targets Android 10 or higher, a SecurityException occurs.
If your app targets Android 9 (API level 28) or lower, the method returns null or placeholder data if the app has the READ_PHONE_STATE permission. Otherwise, a SecurityException occurs
. "
To the ionic native team: I was able to contact kuroshiropanda in accordance with NPM's dispute policy and they have agreed to add me as an owner of cordova-plugin-uid on NPM. Once this is done, I will be able to facilitate method 2 described in my comment above.
@jimlerza congrats
also just a little suggestion you may know it already
just add condition something like below
if (Build.VERSION.SDK_INT >= 26) {
deviceId = getSystemService(TelephonyManager.class).getImei();
}else{
deviceId = getSystemService(TelephonyManager.class).getDeviceId();
}
Can you please update me after updating cordova-plugin-uid?
@jimlerza Any updates on this?
I can kind of make it work, but requires cleaning up crap after installation.
In package.json, both in "dependencies" and "cordova.plugins" I reference "cordova-plugin-uid" not "cordova-plugin-dreamover-uid".
In config.xml I reference "cordova-plugin-dreamover-uid", not "cordova-plugin-uid".
So when I do "npm install" it works fine.
When I do "ionic cordova prepare android", it works, but in the end it adds "cordova-plugin-dreamover-uid" to the package.json file, both in "dependencies" and "cordova.plugins".
Then I have to clean that up manually, otherwise when I run "npm install" again it will fail, with an error:
npm ERR! 404 Not Found - GET https://registry.npmjs.org/cordova-plugin-dreamover-uid - Not found
Far from ideal, but it seems to work.
@jimlerza Any updates on this?
I have suggested 3 possible ways to get this working, but I can't do any of them myself.
Perhaps the owners of this repository will chime in with their suggestion or ultimately close this ticket.
@jimlerza Any updates on this?
Most helpful comment
To the ionic native team: I was able to contact kuroshiropanda in accordance with NPM's dispute policy and they have agreed to add me as an owner of cordova-plugin-uid on NPM. Once this is done, I will be able to facilitate method 2 described in my comment above.