Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic Native Uid plugin referencing wrong cordova plugin #3355

Closed
jimlerza opened this issue Mar 26, 2020 · 11 comments
Closed

Ionic Native Uid plugin referencing wrong cordova plugin #3355

jimlerza opened this issue Mar 26, 2020 · 11 comments

Comments

@jimlerza
Copy link

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.

@nileshbandekar
Copy link

@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 Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/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:\Users\nilesh.bandekar\AppData\Roaming\npm-cache_logs\2020-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.

@jimlerza
Copy link
Author

jimlerza commented Apr 9, 2020

There are 3 ways to make the Native Uid plugin usable:

  1. 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

  2. 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.

@nileshbandekar
Copy link

nileshbandekar commented Apr 9, 2020

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

. "

@jimlerza
Copy link
Author

jimlerza commented Apr 12, 2020

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.

@nileshbandekar
Copy link

@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?

@zolakt
Copy link

zolakt commented Jul 23, 2020

@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.

@zolakt
Copy link

zolakt commented Oct 27, 2020

@jimlerza Any updates on this?

@jimlerza
Copy link
Author

jimlerza commented Oct 27, 2020

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.

@hiimagu
Copy link

hiimagu commented Feb 17, 2021

@jimlerza Any updates on this?

@github-actions
Copy link

There has been no recent activity and this issue has been marked inactive.

@mtsammy40
Copy link

Any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants