50ButtonsEach / fliclib-android

Creative Commons Zero v1.0 Universal
33 stars 22 forks source link

FlicAppNotInstalledException but it's installed. #28

Closed RaviKoradiya closed 3 years ago

RaviKoradiya commented 3 years ago

I am developing an app for my client, Implemented library and followed all steps given in the document. still throwing FlicAppNotInstalledException even though the flic app is already installed and added a couple of flics as well into the app,

Please guide me.

the app is built for version android 30 so target and min SDK both versions are 30. Testing on API level 30 (Android 11).

Emill commented 3 years ago

Does Logcat print anything useful? This happens when the https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int) call returns false.

Anyway, if you want to program for Flic 2 buttons rather than Flic 1, you should use https://github.com/50ButtonsEach/flic2lib-android instead.

RaviKoradiya commented 3 years ago

I required both flic and flic2 support. so implemented both libraries.

registerReceiver(FlicButtonBroadcastReceiver(), IntentFilter("io.flic.FLICLIB_EVENT")) Is it ok if register broadcast like this?

and also have a query, what will be appId in FlicManager.setAppCredentials( ?

Emill commented 3 years ago

Please see https://github.com/50ButtonsEach/fliclib-android#integrate-flic under 1. for your second question and 4 for your first question. You should register the receiver in the manifest if you want the Flic app to wake up (i.e. start) your app when the button is pressed, in case the system killed your app due to inactivity.

RaviKoradiya commented 3 years ago

I have followed those steps, but for 1. It says that appId will be generated from the developer portal, but can't find it there. image

and I have added a receiver in the manifest, but still getting FlicAppNotInstalledException. Please guide me. Logcat seems ok, can't find any useful solution from it.

Emill commented 3 years ago

Just press the developer portal link and login. Then it will look like this: image

Are you sure it's this Flic app you have installed, and not another app by mistake? https://play.google.com/store/apps/details?id=io.flic.app

You could also try this app https://play.google.com/store/apps/details?id=io.flic.apps.flappyflic to see if you get the same error message. It works on my phone at least.

Lastly you could also try another phone, if something is strange with the one you have.

RaviKoradiya commented 3 years ago

I found the issue with the latest android version. as I mentioned that my app is targeting API level 30. Android introduced Package visibility in Android 11. and the flic app's visibility is not open. so any app targeting API level 30 and above will get FlicAppNotInstalledException.

as a quick fix currently I am decreasing the target API version to 29 for my app. but in the future, it will not work.

Thanks for your time and quick support.

RaviKoradiya commented 3 years ago

Also please change appId to key in the document so that any developer does not get confused.

Emill commented 3 years ago

If you add

<queries>
    <package android:name="io.flic.app" />
</queries>

in your manifest and you target API 30, does it work then?

RaviKoradiya commented 3 years ago

Yes, that works, thanks.