Easier Webhook Testing with Ngrok

Picture this scenario :

You have built a web app that has webhooks from other service. But everytime you want to test it out, you have to deploy your app, and keep a look out on your logs as the request trickles in. 

or

You are working with a mobile developer in-house, and you both want to test an API. You deploy the app, even if it is a minute change and then wait to see if all works properly. 

I am sure, as a developer, we have all been there. Deploying apps for a couple of small changes, and make it run through your entire CI/CD cycle can be exhausting. And so I was delighted, when I stumbled upon ngrok.

ngrok is a tool that allows you to access your localhost via Internet. This can save you from countless hours of frustrations by avoiding deploying code for minor changes.

Running ngrok is as simple as downloading the relevant files from the website. Once downloaded, on Mac / Linux – type

Once you have unzipped the contents, ensure your localhost is running and you know the port number. To get your server accessible via Internet, type

This would start ngrok, and now your web app is publicly accessible via the Internet. The terminal also shows the incoming request to your app

The Tunnel URL in my case is http://b3991383.ngrok.io, which points to port 8000 on my device. You can now update the tunnel URL in your webhooks, or pass it on to your client to test the app.

One cool feature of ngrok is it’s live dashboard – which allows you to inspect the status of server as well as the requests that are coming in. You can access this dashboard by navigating to http://localhost:4040/inspect/http

 

 

Apart from using ngrok for development, you can also use it to host your own webmail or other apps. ngrok also offers a paid tier with support for custom domains and other features.

ngrok has been easily one of the tools that has saved me hours of development time, and the paid plan is just worth it.

How to create a Diawi link ?

Overview

Diawi is tool for iOS and Android developers to upload and install applications to their devices. Developer can upload an .ipa file for iOS or the .apk file for Android on the website and then provide the link to the testers or users. The testers/users can open the link in their browser and install the app.

Why should i use Diawi?

  • Easy to use.
  • Faster uploading the app and providing links to the testers.

Prerequisite

Registering an App ID :-

  • Sign in to developer.apple.com/account, and click Certificates, IDs & Profiles.
  • Under Identifiers, select App IDs.
  • Click the Add button (+) in the upper-right corner.
  • Enter a name or description for the App ID in the Description field.
  • Create an explicit App ID and enter the app’s bundle ID in the Bundle ID field.
  • Select the corresponding checkboxes to enable the app services you want to use.
  • Click Continue, Review the registering information and click Done.

Registering a Device:-

To register a device using your developer account, you need to have the device name and device ID.
  • In to developer.apple.com/account, and click Certificates, IDs & Profiles.
  • Under Devices, select All.
  • Click the Add button (+) in the upper-right corner.
  • Select Register Device.
  • Enter a device name and the device ID (UDID).
  • Click Register.

Create a Provisioning Profile :-

  • In to developer.apple.com/account, and click Certificates, IDs & Profiles.
  • Under Provisioning Profiles, select All.
  • Click the Add button (+) in the upper-right corner.
  • Choose the Development method, and click Continue.
  • Choose the App ID you used for development (the App ID that matches your bundle ID) from the App ID pop-up menu, and click Continue.
  • Select the certificates, and click Continue.
  • Select the devices you wish to include in this provisioning profile
  • Enter a profile name, and click Continue.
  • Click Done.

Create .ipa file.

  • Open the Xcode, choose a Generic iOS Device.
  • Under the Project section click Archive.
  • Select the Archive, click Export and then choose Save for AdHoc Deployment.
  • Select the development team, and save .ipa file.

Upload to Diawi

  • Go to https://www.diawi.com.
  • Drag and drop the .ipa file of your app.
  • Click Send after the file is uploaded.
  • Copy the Diawi link and send it to testers/users for installation.