Deeplink parameters for Google Assistant - ios

When I have used deep-linking on past applications, the parameters that are available are well-documented. However, that has not been my experience with the Google Assistant app.
I need to be able to pre-fill and (ideally) automatically pass some prewritten text to the Google Assistant using the deep-link that it will search (invoke) immediately.
In my iOS/Android app, the user will write something: "What's the weather like today"? I can invoke the deep-link to Google Assistant easily via googleassistant:// but do not know how to pass parameters to this link. Maybe it's not even possible, but perhaps someone knows how.
Ideally: googleassistant://query=whats+the+weather+like&invoke=true

Related

POSTing to Google Sheets - Access Token

At the moment I have created two versions of my app - for iOS and Android - Where I use the OAuth workaround of posting to a Google Form to indirectly add to a Google Sheet.
However, I am now planning to remake the app in Google's Flutter (using Dart of course), and would prefer to use the proper direct way of POSTing to the sheet (it will simplify the situation for my client), but am having trouble trying to figure out how to do it.
I've found a simple explanation of how to to do the POSTing, but it requires an Access Token - what appears to just be a string.
After searching for an explanation of this, all I've found is explanations of how to create an OAuth token for the user using the app, but I just want to be able to post from within the app - totally separate from the user.
I guess I want a 'static' token that will just allow me to post to my sheet from my app indefinitely - is this possible, and can someone please explain it to me?
It sounds like you want to use what Google calls a service account for access to a sheet that belongs to your app rather than user's account for access to a sheet that belongs to a user.
https://developers.google.com/identity/protocols/OAuth2ServiceAccount

How to distinguish between a Google Doc and Spreadsheet with the URL?

Is it possible to tell if a URL links to Google Sheets, Google Docs, or another Google app from the sharable link?
The app I am working on allows users to share links, but Safari on iOS devices doesn't seem to handle these links very well. To help ease our users pain, we would like to directly open the link in Sheets, Docs, or whatever other Google app works best, should it already be installed. I have been able to accomplish this by editing the link provided, replacing:
https://
with:
googledocs://
or:
googlesheets://
However, based on the sharable links, it's hard to tell if the link is a Google Doc, Google Sheet, or something else all together. I originally thought Google Sheets used sheets.google.com, but after testing out this change, I realized both Sheets and Docs use docs.google.com for their sharable links. If the wrong app is opened, Google Sheets or Docs will throw an error saying it cannot open the file.
Is there a simple way to make this distinction and ensure the appropriate Google app opens for any given sharable link?
Definitely not from the shareable link. The shareable link is basically just a redirect to the actual document. It's a hash that's generated independently from the original document that is intentionally obfuscated to prevent malicious parties from guessing them.
The only way to know what's on the other side of the link is to visit it or use the Google Drive API to query the document for info.

Google Drive API for iOS: OAuth2.0 with an application-owned account

I'm creating a simple iPhone app. The basic premise is that the app will display some data (That I provide online) on the application. The data changes over time, so the app has to draw the data from online and display it. I don't have a significant programming background so I don't want to use my own server.
Thus, I thought it would be significantly easier to just put the data into some documents on a Google account and then access them programmatically via the Google Drive API. I could then update the data in my Drive account and it would get updated in the application. The key here is that I am ONLY accessing ONE account that I own MYSELF. The users' accounts are not being accessed. Therefore the goal is to never have to log in manually. It should all happen behind the scenes, aka, it should look like a server, not a google doc.
With this in mind, it doesn't make sense to show the Google Accounts sign-in page to my users as the standard OAuth2.0 tutorial shows here:https://developers.google.com/drive/quickstart-ios#step_1_enable_the_drive_api
I should be able to access my own data by somehow hardcoding in my username, password etc. Google agrees here: https://developers.google.com/drive/service-accounts#use_regular_google_accounts_as_application-owned_accounts
The above link mentions a "refresh token" that I'm supposed to save. However, I have no idea how to build and save that token, or even for that matter, where to find it.
I've gone through both the basic tutorial and the Dr. Edit Tutorial for iOS, but they both assume that the application is accessing USER accounts not application-owned accounts.
I'm not asking for someone to write the code for me (though tidbits are nice), but if you can point me to a step-by-step guide or related sample code that would help me get started that would be awesome. I'll even come back and post the code that I use!
EDIT: Since I realized that the Google Drive API wasn't something I could use for what I am trying to do, I eventually found Parse which is an awesome tool that handles all the server backend for me and is free at the basic level.
Google APIs objective-C client library doesn't support service (application-owned) accounts, because they are supposed to be used by a server-side apps, instead of clients -- you shouldn't be distributing your private key as a part of an app.
If you would like to distribute content from a service account, maybe you should write a server leg to do the authentication and pass clients credentials in a secure way for them to talk to the API on the behalf of the service account. Or, use Web publishing to make documents universally accessible without authorization and authentication if privacy is not a concern.

iOS 6 Twitter share without using system account

On a current project I would like to let a user that does NOT have a Twitter account setup login and tweet. Use case: this area of the app is being used by many different end users as part of a check-in process. It is not their personal iPad, they just use it for about 10 minutes to check-in for an event. During that check-in process I want to let them share to FB and Twitter if they choose.
I was able to accomplish the Facebook share without using the system account using Facebook's presentFeedDialogModallyWithSession API, which works great. Is there a similar API in the Twitter SDK? Is there another way I could do this that leverages the Social or Twitter framework?
Recommendations greatly appreciated.
You cannot do this with the built-in twitter SDK. You will need to use the "old" way of doing this, which is via oAuth or xAuth. A good framework for this can be found on github called FHSTwitterEngine. You will need to make your own UI for what you do with twitter itself, but it handles the login/authentication for you as much as possible.
Also this page may be useful to find other 3rd party frameworks (that is updated by twitter themselves) if you need to go outside of their regular SDK and the above does not get you what you want.

iOS Facebook API - Post stories using custom/native UI

I'm starting development of a social app (oxymoron? :p) and wish to implement the Facebook api, however, I want to make use of native iPhone UI (i.e. text fields and buttons) to post stories.
I know it's against their policy to make custom login screens, and I won't do that. Just wish to make my own UI for posting stories and etc.
It kind of breaks my app idea if I can't do this, so really hoping there's a solution.
The dev pages on FB didn't prove much help.
Yes this can be done. Check the samples on the Facebook iOS SDK. You can prompt the user for the status to be sent, and then post this to /me/feed as per their API documentation. You will just need to have the user authenticate with your application first and prompt for publish_stream extended permission.

Resources