How to use Heroku Review Apps with Twilio? - heroku

When a new Pull Request is created for our app, a new Heroku instance is spun up, with a new, unique URL each time.
However, the app needs to handle incoming text messages, which requires that we specify a callback URL in the Twilio dashboard.
Is there a way to solve this catch 22?

Twilio developer evangelist here.
I have not worked with Heroku Review apps myself, so I'm not sure, but here is an idea to follow up on.
The Heroku Review app allows you to specify a post-deploy script that runs once the app is deployed. I don't know if you can get the URL for the new application within that post-deploy script or the environment, but if you can, you can then make a call to the Twilio API to either create a new phone number and set it's SmsUrl or update an existing phone number's SmsUrl to the new application's URL.

Related

Heroku says my custom domain is already in use, despite having already released it

When I attempt to add a new custom domain to my heroku app, I receive the following error
Domain "..." could not be created:
... is currently in use by another app.
See this image:
Example of error in the add new domain sidebar
Details so far:
I use a free dyno for my app
I own the domain and do not use it in any other heroku app (in fact, it's unused for any website)
I used this form, Heroku Domain Release, to release the domain from any existing usage on Heroku. This was successful and seems to imply it was in use by another app at some point.
I ran that form again, and received the message that it was no longer in use by any app.
It's been at least an hour since I tried using the release form and I still receive the same error message when trying to add my domain.
I cannot contact Heroku support directly since I use a free dyno.
Any help greatly appreciated!

Microsoft teams app: How to maintain versioning of backend services

We have developed a app for Microsoft teams and our first version was published on the app store. We are now working on the next version. However we are not sure how we have to submit the new version for team store review without impacting the existing users. For instance, some of our bot commands will behave differently in the new version. If we have only one backend instance running, when we submit it to store team for review we will impact the experience of existing production users as well.
Ideally we would follow a blue-green approach to release new features to selected customers, but in this case we are not really sure how and where to differentiate requests coming (mainly through bot communication, since we can add a app version header in web communication) from multiple versions of the app. We thought of creating new set of resources (app registration, bot channel registration etc) on Azure portal but I guess that would be treated as a new app and not a version update.
Any ideas or pointers on how to achieve this would be of great help.
This is a good point, I don't think there's anything out of the box to deal with this. What you've suggested might indeed be the best way:
create new app registration & bot channel registration, with temporary name (e.g. MyBot2)
update manifest to use new bot, and submit for store approval with this manifest
once approved, and app is live (you can schedule a go-live time when you submit the app), rename both bots (original to MyBotV1 or something, and MyBot2 to MyBot)
In any case, I'd work with the app submission team around this, they're very helpful and engaged.

How can I build a webapp which uses google calendar api without having to become verified?

What I want to build:
I want to build a website where users can connect their google calendars (this will use Google Calendar API's)
and view their calendar events, as well as edit them, and create new ones.
My problem:
In order to do so, google says my app needs to be verified, which can take weeks, and I also need to set up terms of services pages, privacy policy pages
I also need to supply authorised javascript origins which MUST start with https, which of course is a problem during development, since my origin is http://localhost
I also need to set up support emails and homepage link
Question
I just want to start building my application without having to set up a whole production-ready website eco system.
Is there anyway I can use these Google Calendar APIs for editing/creating calendar events locally, without having to set up everything mentioned above first?
Unverified apps can still be used by the developer who created the project on google developer console.
Unverified app screen
The app or script might display an "unverified app" screen before it displays the consent screen. This is based on the specific scopes that your app includes in the request.
You can still work on your app while you are going though the verification process. However that being said i would start that process asap it can take a long time to get verified.
Yes, you can. As far as I am able to tell, all the verification step does is remove the "unverified app" screen. As long as you click Advanced > Go To ... (unsafe), you should be able to create and edit calendar events for that user in your application.
In order to be able to create and edit calendar events, you need to use the most sensitive scope, which is https://www.googleapis.com/auth/calendar. I couldn't figure out how to edit and create calendar events in my web app until I changed my scope from calendar.events to calendar.
Creating Events: https://developers.google.com/calendar/create-events

Two Ionic 3 Apps with the same OneSignal App ID + Laravel Server

I am developing a Uber-like project using Ionic 3. There is an app for the passenger and another one for the driver. Both need to subscribe to OneSignal notifications.
The problem happens when my Laravel server needs to deliver a notification: Both apps have the same OneSignal player ID (based on the device instead of app id), that is, a notification that should be handled by the passenger can be sent to the driver, if both apps are installed on the same device.
So, I need help to know the best way to overcome this problem:
Create another OneSignal app and find a way to make my Laravel server choose which ONESIGNAL_APP_ID and ONESIGNAL_REST_API_KEY to send the notifications to the right app. (Practical, but I'm not sure if this is possible).
Generate another OneSignal Player ID for one of the apps by changing the OneSignal plugin source code. (This solution sounds very stupid, but would solve everything at once)
Make app 1 open app 2 if notification should be sent to app 2. Find a way to pass notification information between apps (deep links?) and make app 2 treat the received information as it was the original notification. (It would be necessary to make it work on Android as well as on iOS. Would it be worth it?)
Just use a service for push notifications that can send the notification based on app id and re-configure the Laravel server.
Which one would be the best alternative? Can there be another one?
My advice is to use Tags. In driver app you will do something like this.
this.oneSignal.sendTag("driver", "true");
this.oneSignal.sendTag("passenger", "false");
and for passenger :
this.oneSignal.sendTag("driver", "false");
this.oneSignal.sendTag("passenger", "true");

Webhook when new domain installed my app

I'm working on GSuite application and wondered how my backend can be notified when new domain admin installs my app?
You can use the license notification api to retrieve a list of current installs. https://developers.google.com/apps-marketplace/v2/reference/licenseNotification/list
After installation the user will probably start or setup your app. You could add your own webhook notification when the user goes through this First Run Experience. (This is what we did)
There is another thing you might be able to pull off: As far as i know, an event is fired to Google Analytics on install. Maybe you can add an alert/webhook in Google Analytics.
However, i was having some problems with the events to show up in GA in the first place.

Resources