📜 ⬆️ ⬇️

UrbanAirship - push without creating a server



The company UrbanAirship has been helping developers since 2009. Their platform allows you to send push notifications on most mobile platforms: iOS, Android, BlackBerry, Windows, PhoneGap. Today we will talk about the main intricacies of using UrbanAirship and the capabilities of the library for the iOS platform.

UrbanAirship is useful for both developers and customers who did not plan to create a server part of their application, but would like to send push notifications to users. In the old days, the service was free and therefore more attractive to novice programmers. But on December 31, 2014, the company gave users a very peculiar New Year present - the trial version became available only for 45 days. The price of the paid version is not published, since it is set individually for the client.

Rumor has it that something turns out around $ 0.001 for one push-notification. Despite the price, the service remains extremely popular, thanks to its convenience and rich functionality.
')
If you are still lucky enough to work with UrbanAirship, the first step is to log in and create your application at go.urbanairship.com/apps . The menu here is simple and straightforward, so after clicking Apps-> Add New App, just follow the instructions. UrbanAirship allows you to create development and production versions for each application. This simplifies the development and testing of applications before publishing in the AppStore. Application status is determined using the AirshipConfig.plist file, which will appear in your project after configuration and integration with the UrbanAirship SDK.

The next important step is setting up your application services on the UrbanAirship portal. This is done quite simply. First you need to create push (APNS) certificates (development and distribution) for your application and export the keys from Keychain.

There is one nuance here - it is important to make the export correctly. It is necessary to select the APNS certificate, and not the key itself. In this case, everything goes with a bang:



And this option will give out the 500th error when trying to import the key into the UrbanAirship.



The key p12 obtained by exporting from keychain and its password must be specified in the Settings / Services of your application in UrbanAirship:



Now it's up to you - it remains to add an SDK to your iOS application. This process is described in detail (even with pictures) on the UrbanAirship site, so we will not stop at this step.

Let's go directly to using the UrbanAirship. Two types of notifications are immediately available: normal push and Rich. Rich messages, unlike regular ones, contain not only text, but also images, links and whole pages of content.
To create and send messages, click the lowest button on the left of the menu:





Creating messages is very intuitive, interest is only one point:


That is, you can send a message (except for the option “all at once”) to a device with a specific tag. The tag is configured on the application side using methods:

[[UAirship push] addTag:@"a_tag"]; [[UAirship push] updateRegistration]; 


You can also send a message to one device, specifying its token, and devices from a specific segment (the creation of the segment was mentioned above).
Sending messages, receiving them, user actions and other details can be seen in the statistics (Reports).

In addition, UrbanAirship allows you to easily create view controllers, which will contain a list of all Rich Push-notifications delivered, mark the read and show the contents of each. The UI and the functionality of this controller (UAInboxMessageListController) goes to the library, but can be changed and configured for its own needs.

Conclusion

Many complain about the high, in comparison with other services (for example, Parse), the price of UrbanAirship. I did not study analogs, but, at first glance, UrbanAirship provides more features and is easier to use.

Author : Maria Nazarenko, DataArt iOS developer.

Source: https://habr.com/ru/post/267105/


All Articles