Importing google calendar availability for clients in flutter - flutter

I am creating an app for a business where the user is able to select an available time slot for an appointment, then schedule it. On the backend I'd like to pull available times from my personal google calendar, let them select a time slot, then see the events autopopulate to my google calendar so I have them clearly there. I am having a really hard time finding documentation on how to use the google calendar API to pull events from a hard coded (not a user authentication sign in) google account. Can anyone help here?

Related

Google Action certification taked too long

We are a smart home product development company and we have been working on voice assistants integration and Google action is actually part of our assistant integration. We developed and submitted our initial google action for the certification that will be shipped with our product to the customers. As per in the action console release page, they state the review may take 5-7 days and will be notified via an email once review is completed but it's been longer than said days now, we didn't hear back anything yet. We are unable to find any support email to google action for direct inquiry hence we don't have any clues what's the actual status with our google action. Is there any support email, we can directly reach out to google action support rep like in Alexa? The critical part is our marketing team has planned to release the product within next couple of weeks. So, we have to make sure the google action developed is on Live.
This is a dedicated page for actions that are stuck in review, but it also offers some other support options.
https://support.google.com/actions-console/contact/support

Requesting and storing a users's phone number

I am using the new Google Action development environment. I would like to request a user's phone number and also give the user the option to save it for future interactions. This is so I can send text messages and make phone calls for them. Is there a way for me to do this that is compliant with the T&Cs for Google Assistant actions?
Please check with your lawyer, as every country has its regulations. For more info, consult this guide. https://developers.google.com/assistant/conversational/storage-user

Action with different fulfilment URL based on user's location

I work for a company that is building a Google Action which will be available in AU, NZ & UK. Depending on the location of the user, the fulfilment URL needs to be different as each country has its own APIs, etc.
We could achieve this easily by deploying three separate apps, restricted to their particular country, each having their own fulfilment URL. However, if my understanding is correct, they would all have different invocation names which is not ideal.
Another way we could potentially achieve this is by making the user choose which market they want (AU, NZ, UK) on the account linking page and then use the APIs for that market. However it doesn't seem to be a great UX.
Ultimately the key goals we're trying to achieve are
Users in AU, NZ & UK can all invoke the Google Action by saying "Ok Google, Open App", rather than "Ok Google, Open App NZ", "Ok Google, Open App UK", etc.
Users don't have to choose market (AU, NZ, UK) they belong to - it happens automatically
We can use the correct API based on the market the user belongs to.
There is no way to have different fulfillment URLs for the same Action.
You also have a slight issue when getting their location - you need to request it explicitly from them. Once you have this, however, you can store it (with their permission) to use it again in future requests, so you only have to do it once.
You will need to check to make sure it is one of the locations you serve, and you may want to allow them to change it (what if someone from the UK is traveling to AU?).

How to implement auto renew subscription in app billing google play

I'm researching method to implement auto renew subscription in app billing with google play. I read https://developer.android.com/google/play/billing/billing_subscriptions.html and see
Billing continues indefinitely at the interval and price specified for the subscription. At each subscription renewal, Google Play charges the user account automatically, then notifies the user of the charges afterward by email. For monthly and annual subscriptions, billing cycles will always match subscription cycles, based on the purchase date. (Seasonal subscriptions are charged annually, on the first day of the season.)
When the subscription payment is approved, Google Play provides a purchase token back to the purchasing app through the In-app Billing API. Your apps can store the token locally or pass it to your backend servers, which can then use it to validate or cancel the subscription remotely using the Google Play Developer API.
So have any method to my server know when user's subscription was renewed? Instead of google play send new bill subscription to android app after that android app send this new bill to my server just for validate.
Can google play send a notify to my server when user's subscription renewed such as notify the user by email ? I want to google play send me a notify that user's subscription was renewed automatically so that my backend will update expire their subscription in app increase. Don't need android app have to check bill each time user open store to check have new bill from goole play charge automation or not. Do it implement?
My workfollow
Google charge a new cycle subscription and notify to my server { body such as bundId, bill, product_id or subscription package name, expire date...), also sent mail to user about their subscription automation renewed.
My server determine change subscription of the user and validate in app purchase by google play api and change expire package subscription in your app if validate is valid.
Store newest bill in my db
Is that possible?
[Update] Recommend from goolge play api doc
Recommendation: Include business logic in your app to notify your
backend servers of subscription purchases, tokens, and any billing
errors that may occur. Your backend servers can use the server-side
API to query and update your records and follow up with customers
directly, if needed.
How to implement recommend from google api, any doc or tutorials ?
I have currently exactly the same problem. The concept of Google is not well-conceived. There is a possibility to notify your backend server about financial transactions (see here), but I would not recommend this. You rely your business transactions on a lot of Google services and your server uptime. If anything goes wrong or is down or something, you will not be informed and your backend business logic does not work anymore.
This recommendation of Google you mentioned sucks as well. What happens if there is an auto-renawal (which delivers a new purchaseToken to your app) and the user never opens your app. Then the new subscription data will never be transferred to your server. And if you never got a new token, how can you check, if the user is still a subscriber, since this limited Google Play Developer API stupidly needs a purchaseToken as parameter (see here) that you never get as long as the user does not open your app at least once after an auto-renewal (to submit it to your server).
I think about implementing this in this way:
1.) I continuously check the purchase records by cron job. A purchase record is a database entry which contains all data from the initial subscription (orderId, purchaseToken, and so on, all that is needed for the security validation process on the server). Every purchase record is connected to a user's account (some UserID) in my backend system. As long as the autoRenewing attribute of the purchaseRecord is not false, the subscription is valid. Even if the expiryTimeMillis is exceeded, this one user could still have a valid subscription, because of the use case I described above: Subscription will be auto-renewed by Google, but the user never opens the app, so no transfer token is sent to your server and you are still not informed about the subscription update.
2.) If the use cancels his subscription any when, the autoRenewing would be false at any time. That means that the subscription will indeed end at the expiryTimeMillis.
3.) When the user opens your app and transfers the new purchaseToken to your backend, you will get a new purchase record which is again connected to the user account with his User ID. The user will probably have 2 purchase records now. The old one and the new one. If so, you could delete the old one, and the same process repeats with the new purchase record at step 1.
I didn't have implemented the concept so far, so I don't know if this really works like this. Maybe this could work in a different manner, but maybe it's a step into the right direction.
I don't think, relying upon daily basis cronjob is a feasible way to go about this problem, It is messy and you have to also consider the case when your application is handling too many requests, you have a limit of transactions that made using android developer's api. The better way to implement it would be to use google's recommendation. Which stats:
...
Note: Due to quota restrictions, it is not recommended to check state by polling the Google Play Developer API at regular intervals instead of leveraging Real-time developer notifications.
...
Here, You can follow the following url
How to get expiry date for Subscription with client side in Android? and to implement the auto-renewal subscription.

How can I set up a webhook or subscription from Presence Insights?

I have been using IBM's Presence Insights to gather indoor location based information. How can I get Presence Insights to send me updates about location events that are important to me? I would like to perform some action when, for example, a mobile devices enters my "entrance" zone.
You can set up Subscriptions to get an HTTPS POST every time a certain exit/enter/dwell event happens in a zone, group of zones, tag, or group of tags. You will need to provide a callback URL to Presence Insights that will be the endpoint that receives the POST.
You can create a subscription pretty easily within the Presence Insights UI:
Ensure you have a site configured with a floor map, zones, and beacons/sensors in place.
Click on "Management" heading
Click on "Subscriptions" subheading
Click on the blue "Create Subscription" button on the right. Fill in the popup:
The "Webhook URL" is the HTTP endpoint owned by you that will receive the POSTed event from PI. (More on this later.)
Check the boxes for the different events you are interested in (Enter, Dwell, Exit, Timeout)
Username and Password are BASIC AUTH credentials for your "Webhook URL" above.
Select the site name/tag that you are interested in with the dropdowns.
Select a zone tag. You can tag multiple zones with the same tag, or have unique tags for each zone, or a combination of both.
Ensure that "Active" is checked. If you want to disable this Subscription at any point, you can simple uncheck the Active button.
Regarding a Webhook URL - this generally requires a server. You can mock up an endpoint very quickly using Node.js, or my personal favorite, NodeRED. We have example NodeRED flows out there already, see this tutorial: https://github.com/presence-insights/pi-sample-NodeRED/tree/master/Eventing
The idea of Subscriptions is to allow any events that are detected and passed into Presence Insights, to also be shared with additional applications, i.e. A marketing / offer engine, or system to create Mobile Push marketing messages as examples. The data that get passed out of Presence Insights includes the device id, location, and any additional device information that has been included in the device registration document. Again, this could include a phone number, loyalty card number, or any info you wish, which can be both encrypted or not. The Doc' s detail how to set up a Subscription event; Management -> Subscriptions -> Create a Subscription via button -> Set the URL you wish the info to be passed on to { this would be your application } -> then select the location you wish to trigger Subscription event, and event type. ( i.e. You select a complete floor or site, and when an event happens at that site or floor, and subscription event gets created and forwarded out of PI). You can then also focus the event, so may be only when in a zone or such.
Its hard to show an example, but when we do demos, one of the applications that very easy to setup and configure to receive these Subscription events, and then perform some action is the Open Source package 'Node-Red' (nodered.org) which is also available in Bluemix (https://console.ng.bluemix.net/catalog/starters/node-red-starter/). You then create a flow such as ..
Picture of Node-red flow