When a player first signed in using com.google.android.gms.plus - android

My current Android application allows users to signin using the Google Plus button.
A feature of my application is that i would like to reward users who return within a month of first signing in.
Do i have to remember when they first signed in using Google Plus?
Or does the com.google.android.gms.plus API expose this detail? e.g. initial Sign In date cross referenced to my Application.
I have searched the com.google.android.gms.plus docs but couldnt see anything.
Did i miss something?

I'm not aware of a G+ API that tells you when a user first authorized an application. I would recommend using Androids app data storage. That should be pretty lightweight. You can also open a feature requests.

Related

Unable to integrate Lyft API into Android App

I am trying to integrate the Lyft Ride Request API into my Android app - specifically the Lyft Button. When I attempt to add my app in their developer's console, I see the following after adding the app:
On April 15th, Lyft made changes to its developer platform. As a
result, this application no longer has access to the API platform. You
can read more about the changes here. If you think this change is made
in error, please reach out to your Lyft representative.
The link that is provided does not contain any relevant information nor is there anyone or anything to consult on their website for assistance.
Is the Lyft Button no longer available. If it is, what are the app requirements?
So I decided to ignore the No Access message and I went ahead and integrated the Lyft Button API into my application and all seemed to work.
Lyft Button API integration for android is at this URL:
Lyft Button API
One point of confusion was the requirement for a client token and client id. You do not have to supply a token or an id. You can use "..." as shown in the API instructions for both values.
I was able to confirm that the button is successful in grabbing start and destination locations and launching the Lyft app which then shows the route and vehicles in the area with ride prices.
There is no sandboxing option for testing, so be careful. It looks like any rides you order and confirm will be charged to your credit card.

How to add client id to Google Drive Client API for Java

I'm just getting started with using the Google Drive REST API in an Android app. (I can't use the Google Drive API for Android because the app needs to share files, and perhaps a few other things, that GDAA doesn't support.) I'm stuck on a couple of points.
The first has to do with OAuth2.0 credentials. I went through the Android quick start example and it works fine. I set up a project on my Google developer console and generated an OAuth2.0 client ID and secret and also downloaded the JSON credentials file. However, the quick start example doesn't show how to plug any of this into the app. The only thing I found in the docs that seems relevant is GoogleClientSecrets, but I don't see anything about how to use that in an Android app. (The Java quick start example uses this, but it's not integrated with Android's account manager and doesn't seem right for an Android app.) When I run the Android version of the quick start app, no activity shows up on my developer console, which suggests to me that the app is running in some sort of anonymous mode. As I understand it, that would limit the app to a very low daily quota of transactions.
Second, I noticed that the GDAA and the REST API for JavaScript both have nice file picker APIs. I couldn't find anything similar in the Java/Android API.
So here are my specific questions:
How do I use my app's OAuth2.0 credentials from the developer console in a REST API for Android Java app? I feel like I'm just missing something obvious.
Is there a file picker API for the Google Rest API for Android?
After stepping through the library as I executed the Quickstart example (a painful process, as there is no source code), I discovered the answer. It turns out that you need to specify the client ID in the manifest. Specifically, you needs the following under the <application> tag:
<meta-data
android:name="com.google.app.id"
android:value="app ID from your API console"/>
Once this entry is in the manifest, then when the app uses the Google Drive REST API to interact with Google's servers, the transaction is correctly logged as traffic in your app's console. Without this entry, the app seemed to work in my testing, but no traffic was logged. I seem to recall (from an old Google I/O video) that such "anonymous" apps still work, but have a very low usage quota (something like 10 or 100 queries/day).
For those who are curious, I found this key in the class com.google.android.gms.common.internal.zzz, found in the play-services-basement-10.2.0 library.
Save the client_id.json file downloaded from the Google API console into into your app's src/main/res directory.
I was stuck exactly the same, but after I built my app with the file included the Google API started working.
How do I use my app's OAuth2.0 credentials from the developer console in a REST API
The pages around https://developers.google.com/android/guides/api-client give you all that you need to know. In particular, note the Java Quickstart you were using is for generic Java. The way Google Play Services on Android manage credentials and accounts is very Android-specific.
Is there a file picker API for the Google Rest API for Android?
Not that I know of, but depending on your use case, you might be able to use the GDAA picker. Ultimately, both GDAA and the Java REST API are layers above your Drive storage.

Automatically sign into Google account on Android webview

This past week I've inundated myself with links and led myself in too many circles to count, so I thought I'd pose the question here. I have an Android app that displays webviews pointing to urls which the user must be signed in with their Google account to see (the backend is built in Google App Engine). Since the end user is likely to be signed into their Google account on their Android anyway, I'd like the sign-in process to be automatic. Currently, on the first webview the user opens up they are presented with the Google sign-in form and a really ugly subsequent page asking "would you like to allow example.appspot.com to use your Google account?"
That process is dreadful for user experience. I've seen precious few resources here and there concerning auto-login, but I'm frankly lost in the sea of almost-what-I-want-but-not-quite to be able to discern the direction I ought to be going.
I read through Nick's tutorial on authenticating an app with App Engine, but just having the token doesn't get me the uniquely-assigned user ID associated with every Google account on the backend. On top of that, prior experience has taught me the hard way that an app's webview session is incongruous with the app's HTTPClient session. So even if I could log in with Nick's method it wouldn't help me sign into the webviews.
Then I came across this tutorial, which actually seems really promising, but so far I haven't been able to adapt his code to work with my own.
I also found this SO link which suggests that all I need to do is pass the auth token (which I could presumably obtain via Nick's method) into every webview I load as a cookie.
And that's about it. They are all rather different approaches, so I'm wondering if any of them are actually what I want. Or, if somewhere out there a reasonably simple approach actually exists. I'd really appreciate it if someone knows of a straightforward answer on this one. Thank you!
For security reasons WebViews do not have access to the phone's cache, cookie store etc, it is instead recommended you use the new Chrome Custom Tabs which can auto log in your users.
Concerning the "would you like to allow example.appspot.com to use your Google account?" screen; this is the standard OAuth process and requires that the User sign in and allow your app to access their account information.
In your 'example.appspot.com' App Engine app, if you are using an API that requires user information, like the Google Calendar API, it is required that you specifically request the User for their approval to access this information.
Once you have their approval, you can then save the access and refresh tokens to make future API calls on their behalf without the need for repeated user consent. You can see how the entire Oauth flow works in the OAuth 2.0 Playground.
Even if you automatically logged your user in, they will still see the approval page requesting for your app to have access to their information. To develop a hack to forcefully approve the access to a User's information on their behalf is a major security violation.
You can take a look at the new Firebase Authentication flow to easily manage your user's Oauth experience in your App Engine application.

Android: google plus app integration for content comments

I have created an app which has different content pages. Every page has an unique ID. I want the user to get into interaction with these pages by commenting or asking questions.
I want to have a separate google plus webpage for my app. The content in google plus does not yet exist but should get generated if a user comments a page for the first time. I also want to browse through all comments by web browser.
Is there a prefered way to do this or a tutorial for my problem? Thanks
Tata
this is probably not possible at the moment due to this limitation: Note: The Google+ API currently provides read-only access to public data. All API calls require either an OAuth 2.0 token or an API key. - okay facebook though

Is it possible to use the Facebook mobile SDKs for only mobile app install ads?

I am not currently using Facebook's Android SDK in my Android app, and I only want to integrate it enough to capture installs via Facebook Mobile App Install Ads.
The documentation describes the need to "[c]omplete your Basic page under App Settings." If I enter my app's package name--and only its package name--I get an error:
You have specified Package Name, but you did not specify Class Name. Launching a native Android application requires both.
I don't want or need my app to be launched, do I? I only want to track conversion rates of ad clicks to app installs (and runs). The only way I can get the Promote link to show up on the left is to supply values for Class Name and Key Hash and set Facebook Login to Enabled. Is this really necessary?
Yes, it is necessary to fill out those basic details to use our SDK, however, those fields are only used for login authentication via fb - which is the most popular use case for our SDK. Your app will not be launched or anything like that if you supply those fields. For your case, just fill them out and leave it as is and you will be able to run ads without worrying about anything else.
The API requires these fields. Although in my experience it doesn't launch your app. It is merely used for the credentials in the development side of the Facebook integration in www.developer.facebook.com
Hope that helps.
RF

Categories

Resources