Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Plugin does not work on Android 11 #140

Open
iglombardo opened this issue Jan 22, 2022 · 5 comments
Open

Plugin does not work on Android 11 #140

iglombardo opened this issue Jan 22, 2022 · 5 comments

Comments

@iglombardo
Copy link

Anyone using this plugin on Android 11? Was any different configuration required? My app works on 10 but doesn't work on 11.

@darryncampbell
Copy link
Owner

Hi @iglombardo , I use https://github.com/darryncampbell/plugin-intent-api-exerciser to test this plugin and that app appears to work well on my Pixel phone running A12. What is it that does not work exactly? And, does https://github.com/darryncampbell/plugin-intent-api-exerciser work for you?

@iglombardo
Copy link
Author

iglombardo commented Feb 1, 2022

Hi, @darryncampbell ,
Here's the function I'm using, and below is a link to a video working on Android 10 and the error on Android 11.

`
function openDetkSgin(numero_oc) {
if(typeof numero_oc == 'undefined') {
numero_oc = '360739';
}

   window.plugins.intentShim.startActivity(
	{
		action: window.plugins.intentShim.ACTION_SEND,
		component:
			{
				"package": "com.vjnicacio.detksign",
				"class": "com.vjnicacio.detksign.MainActivity"
			},
		type: "text/*",
		extras: {
			//  Change this URL to a URL of an actual picture on your device
			'android.intent.extra.TEXT': numero_oc
		}
	},
	function() {},
	function() {alert('Failed to open URL via Android Intent')}
);

}`

Work

Not Work

@darryncampbell
Copy link
Owner

You might want to debug into the native code to see what exactly is causing the error: https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/blob/master/src/android/IntentShim.java#L77.

I have an example showing how to send an image in the exerciser app: https://github.com/darryncampbell/plugin-intent-api-exerciser/blob/master/www/js/index.js#L103 which seems to work. Usually these type of A11 issues are down to scoped storage, in my experience.

@iglombardo
Copy link
Author

Hi @darryncampbell ,
to work it was necessary to add this in manifest.
In the logs of Android Studio it presented the message "PackageSetting{bcc13fc com.vjnicacio.detksign/10154} BLOCKED"

<queries> <intent> <action android:name="android.intent.action.SEND" /> <data android:mimeType="text/*" /> </intent> </queries>

@darryncampbell
Copy link
Owner

Great! thanks for replying back. Are you able to use https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#edit-config to make this update?

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

No branches or pull requests

2 participants