I'm using Firebase UI Sign In and trying to implement Facebook sign in into my android app. When launching the firebase ui activity I get:
"java.lang.IllegalStateException: Facebook provider unconfigured. Make sure to add a facebook_application_id string"
In my string resources I have added it, this is how it looks:
By the way in the firebase docs the string names are different from the ones in the facebook docs, this is how they look in the facebook docs or also called quickstart:
`<string name="facebook_app_id" translatable="false">SOMECODE</string>
<string name="fb_login_protocol_scheme"
translatable="false">SOMECODE</string>`
This is how it looks in the firebase docs:
<string name="facebook_application_id"
translatable="false">YOUR_APP_ID</string>
<string name="facebook_login_protocol_scheme"
translatable="false">fbYOUR_APP_ID</string>
I was also having some merging problem and fixed it by adding tools:replace="android:value" to the metadata and yes everything was added inside the application tags
<meta-data android:name="com.facebook.sdk.ApplicationId"
tools:replace="android:value"
android:value="#string/facebook_app_id"
/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
I don't know what's causing these problems but I think it has something to do with the string names, if anyone can help me please I will immensely appreciate it. Thank you!
Add Facebook Provider in Manifest as mentioned here.
Append your app id to the end of the authorities value. For example if your Facebook app id is 1234, the declaration looks like:
<provider android:authorities="com.facebook.app.FacebookContentProvider1234"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
Use this is AndroidManifest.xml
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/FACEBOOK_FB_APP_ID" />
and in strings.xml
<string name="FACEBOOK_FB_APP_ID">{application id}</string>
Alright I was thinking that the strings provided by firebase and the ones provided by facebook where the same and I had to have only a pair of them, the truth is that they are different and add the ones provided by firebase and facebook to your string resources, that will solve the problem.
Related
Whenever I upload my base and feature APKs to Play Store I got these errors :
You must provide a default URL for your Instant App APKs. Learn More
Your site 'www.example.com' has not been linked through the Digital
Assets Link protocol to your app. Please link your site through the
Digital Assets Link protocol to your app.
You should have at least one active APK that is mapped to site
'www.example.com' via a web 'intent-filter'.
And here is my manifest file : (EDITED)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ex.example.feature.productdetail">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application>
<activity
android:name=".activity.ProductDetail"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait">
<meta-data
android:name="default-url"
android:value="https://www.example.com/product/12345" />
<meta-data android:name="asset_statements" android:resource="#string/asset_statements"/>
<intent-filter
android:autoVerify="true"
android:order="1"
>
<category android:name="android.intent.category.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http" android:host="www.example.com"/>
<data android:scheme="https" android:host="www.example.com"/>
<data android:pathPattern="/product/12345"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
</application>
</manifest>
I put the assetlinks.json file to my web site, and when I proceed test link file, it gives success.
What am I doing wrong any idea?
Thanks your help in advanced
This is because the default URL you specified (https://www.example.com) is not supported by the intent-filters in your Instant App (https://www.example.com/product/productId).
You will either need to update the default URL so it points to a supported URL, or add a new intent-filter that supports the default URL.
You must specify the host of your domain in the manifest, you can not use www.example.com
> <data android:scheme="http" android:host="www.yuorwebsite.com"/>
> <data android:scheme="https" android:host="www.yuorwebsite.com"/>
, also before the intent - filter in manifest, specify
<meta-data
Android: name = "default-url"
Android: value = "https://yourwebsite.com/main" />
I agree with #KitKat and AdamK. Based from this documentation. To allow Google Play and Android launcher to discover your app, you must provide at least one activity as the entry point for your app. In the manifest for your app, the entry point activity must have an <intent-filter> element that includes the CATEGORY_LAUNCHER and ACTION_MAIN intents.
Your app must also define a default URL for your app. Within the same Android manifest as your entry-point activity, you define the default URL for your app by adding a <meta-data> element with a value attribute that provides a valid HTTPS URL that the activity can handle. Further, this default url must also be part of the CATEGORY_LAUNCHER activity's intent filter in the installed app.
I know this has been asked before, and I have looked through a lot of those questions, but none seems to hold the answer for me.
What I am trying to do is to open my app when I click a link, which in my case would look like dots://test.com/. I'm trying to get this working through intents. When I replace dots:// with http:// and use http in my scheme instead of dots, it works fine. But since the only domains I own have got pretty long urls, it's not practical to go that route.
My android manifest looks like this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:logo="#drawable/logo"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="ADMOB_ALLOW_LOCATION_FOR_ADS"
android:value="true" />
<activity
android:name="nl.delta6.dots.engine.MainActivity"
android:exported="true"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="dots" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
I have tried numerous solutions mentioned in posts like Make a link in the Android browser start up my app? and Launch android application from a browser link, but none seem to work for me. All ideas are welcome.
Edit 1:
Okay, so I noticed that if I click a link on a webpage like dots link, it does launch my app. The links just don't show as links in other apps, though I know that is possible. I'll keep looking around, but if there's anybody who could send me off in the right direction that'd be more than welcome.
I think the best article is here: Make a link in the Android browser start up my app?
Note that you really want to use hackbod's recommendation, which means that registering the scheme "dots" to yourself is not a good idea. The easiest way to create a link that a browser can use is to first, in a test setting, have your intent format itself to a uri:
Intent intent = new Intent(someContext, MainActivity.class)
System.out.println[or use logcat](intent.getUri());
Then just paste the output from intent.getUri() as a url. It will look something like:
intent:#Intent;component=[your/activty/class/NameActivity;]
If you serve that as a link on a website, connect to it on your phone with your app installed and click the link it should then open your app.
Note that you can also add "extras" to your activity using putExtra if you want to see example intent uris that can be used to send extra data back to your app.
I've got an application that has two search suggestion providers that both extend SearchRecentSuggestionsProvider, and I've set it up correctly in the manifest file with the following Intent filter and meta-data:
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable_tv" />
The searcable resource includes android:includeInGlobalSearch="true", so that should be fine.
And I've obviously got a provider there as well:
<provider
android:name="com.miz.contentprovider.TvShowContentProvider"
android:authorities="com.miz.contentprovider.TvShowContentProvider"
android:exported="true" />
This all worked just fine in Android 4.3 using the Google search application, but I've just updated all my devices to Android 4.4 and I am no longer able to search content within my application. Same thing goes for other applications that worked before the OS update, i.e. Google Play Music.
I've found a thread on XDA developers that mentions this as well, if it helps: http://forum.xda-developers.com/showthread.php?p=47472102
Does anyone have any idea what's happening or how it can be fixed?
Update: I can confirm that it only occurs on devices with Android 4.4. I've tested on an Android 4.3 device using the latest Google Search update, and it works as expected. Looks like it's a bug in Google's update.
I found this commit in AOSP, which might be related:
https://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf356c15143ab0583c64682de16d94a57f7dd1c
The commit message tells us that this feature was removed due to performance reasons (which might or might not be true, given that it references an internal ticket id and I didn't find a related issue about this on the official bugtracker).
I checked with contacts at Google, and App Indexing is replacing this. The documentation will be updated to show this as deprecated, and there is no way to get this feature to work on Kit Kat without system level permissions (as iDev showed above).
Google Chrome appears now as a searchable app since its last update (v31).
System Application:
Have try like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.globalsearch" android:sharedUserId="android.uid.shared">
<uses-permission android:name="android.permission.GLOBAL_SEARCH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
<application android:label="#string/global_search" android:process="android.process.acore">
<activity android:name=".GlobalSearch" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" android:stateNotNeeded="true" android:theme="#android:style/Theme.NoDisplay" android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- This must be higher than the default priority (0), which
is what GoogleSearch uses. -->
<intent-filter android:priority="500">
<action android:name="android.search.action.GLOBAL_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.app.searchable" android:resource="#xml/searchable" />
</activity>
<activity android:name=".SearchSettings" android:label="#string/search_settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<action android:name="android.search.action.SEARCH_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<provider android:name=".SuggestionProvider" android:authorities="com.android.globalsearch.SuggestionProvider" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
<provider android:name=".StatsProvider" android:authorities="com.android.globalsearch.stats" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
<meta-data android:name="android.app.default_searchable" android:value=".GlobalSearch" />
</application>
</manifest>
i want to add the MiniMob Ads in my android application. I have read the full documentation from the http://www.minimob.com/integration-guide.html for minimob sdk, but i still dont get it.
Now i have two queries:
We have to give the app url either of the android market or some other when we create new app using the MiniMob sdk. So how can we give that url like 1st upload the app without that minimob integration and get the url of the app and then again upload with the minimob integration.
And the 2nd thing is we have to just give that app id, app key and package name in the manifest and add the jar file in lib. and rest some code which i shown below in that activity where we want to show these Ads. Am i wright ??
<!-- MiniMob Manifest declaration start -->
<activity android:exported="false"
android:name="com.minimob.android.OptinActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="\#android:style/Theme.Translucent" />
<activity
android:taskAffinity=""
android:name="com.minimob.android.PushAds"
android:configChanges="orientation|keyboardHidden"
android:theme="\#android:style/Theme.Translucent.NoTitleBar"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="com.minimob.android.DeliveryReceiver"
android:exported="false"/>
<receiver android:name="com.minimob.android.MessageReceiver"
android:exported="false"/>
<receiver android:name="com.minimob.android.BootReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
<meta-data android:name="MINIMOB_APPID" android:value="id:$appid" />
<meta-data android:name="MINIMOB_APPKEY" android:value="key:$appkey" />
<meta-data android:name="MINIMOB_APPHOST"
android:value="http://mpm.minimob.com/mobile/serve.asp" />
<meta-data
android:name="MINIMOB_ACTION" android:value="com.minimob.android.PushService$appid" />
<service android:name="com.minimob.android.PushService" android:exported="false">
<intent-filter>
<action android:name="com.minimob.android.PushService$appid" />
</intent-filter>
</service>
<!-- MiniMob Manifest declaration end -->
Regarding the app URL, it is there so we can have access to an app for a number of reasons (e.g. troubleshooting). If your app is not publicly available yet you can temporarily enter a random URL and update with the correct URL later when the app has been accepted in Google Play or another app store.
About your second query, please do the things below everytime you want to integrate the Minimob SDK in an app, as it is custom built for each app and instructions will slightly differ.
Go to the Applications page in Minimob and register your app
Click on the "Download SDK" button next to your app
Open the "Instructions.txt" file
The steps are pretty much the ones you have mentioned (copy the .jar file, copy-paste the permissions and declarations in the manifest, add call in your main activity that starts the Minimob SDK).
My searchable activity currently looks like this in the Android Manifest:
<activity
android:name=".activity.Search"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
I would like to be able to add my application to the preinstalled "Google Search"-app as a searchable element and therefore accept its search intents.
Seems correct. Did you enable your app in the Google-Search app settings, to be searchable?
I just found this page on the android dev blog. What I've been missing was the xml attribute android:includeInGlobalSearch="true" in my searchable.xml.