TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Apache 2 |
ReleasedLast Release | Apr 2016 |
Maintained by David Hoerl, Chris Sanders.
Welcome to the Sailthru SDK distribution site!
You will find everything you need to incorporate Sailthru's iOS SDK into your applications. If you add yourself to the Watch List by tapping on the Watch button, you will get notified each time the repository changes.
If you just happened on this site, you can discover how Sailthru can can address your company's marketing challenges and transform its business here.
If you have not heard about CocoaPods before, it's an open source system by which users can better manage the inclusion of mutiple external libraries or open source code.
Each distribution is tagged using sematic versioning that has the form X.Y.Z.
Choose a Release from the GitHub release menu, which lets your retrieve a zip archive of the release, which includes every file in this repository. This archive is equivalent to older distributions that you received from your Sailthru account manager.
Clone the proper repository version using git, then checkout the desired release (which is prefixed by a 'v' character). On the command line this would take the form of:
$ git clone https://github.com/sailthru/sailthru-mobile-ios.git $ git checkout tags/vX.Y.Z # X.Y.Z, or just don't run this command to get the latest
The Sailthru iOS SDK provides:
The SDK supports a version method, so you can verify in your code that in fact you've retrieved the desired distribution release.
Sailthru provides the ability for your push campaigns to set key/value pairs—both strings—along with the alert text. To achieve a 'deep-link', your app needs the ability to translate a key/value into a series of actions so that it can present an appropriate view when the user taps on the notification.
For example, if your app uses a REST interface, and uses 'product_id' to uniquely identify products, the notification could include a key/value pair such as '{ "product_id": "20134" }' in addition to the alert message of 'You should love this great new widget!'.
When your app finds this particular key/value pair, it would first see if the product '20134' was currently cached within the app, and if so, navigate to a view that displays it prior to showing any UI. Otherwise, it could pop a spinner, inform the user in a HUD that it's retrieving that product, then show it once received. If plain product numbers don't make sense in your app, then send it a URL to something that's actionable within the app.
To avoid popping spinners, you can use 'silent' push notifications (ones with no alert text) that inform the app of potential products that may be included in a subsequent alert-style notification; the app would then use background fetch to retrieve and store them.
Alternately, always use 'silent' push notifications, include the alert text as a key/value pair, and when your app has retrieved the relevant information it can pop a local notification that to the user looks no different than a remote one.
Q: The SDK won't work with iOS9 Beta
Apple iOS9 introduces enhanced network security features. Currently, when the SDK attempts to contact Sailthru.com, a known issue at our site results in an SSL error. To work around this add the following to your info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>sailthru.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
This allows your app to communicate with any subdomain on sailthru.com, but does not otherwise affect your app's security. Sailthru is actively working to update its site so that no exclusion would be necessary.
Q: Have you tested with iOS8/iOS9? Swift?
Yes - the SDK works properly with iOS versions 7 to 9, and also interoperates with Swift.
Q: What are the most common problems integrating the Sailthru SDK?
Q: How do I obtain the key/value data that I added to my Push Notification?
Client added JSON data (key/value pairs through the UI), when attached, are moved as a dictionary to the top level dictionary with a key of json, and are thus a peer to the Apple supplied aps dictionary. The modified dictionary is then returned by the manager's *didReceiveRemoteNotification:isBooting: *method.
Q: Does the SDK hard link to system frameworks, and if not, which ones must my app add?
The library optionally links the Foundation and SystemConfiguration frameworks; thus client apps must link to SystemConfiguration if not already doing so.
Q: Does the SDK add categories to any of the standard Foundation classes?
No, the SDK does not add categories on anything other than its own classes.
Q: Does the SDK pollute my app's namespace with classes other than ST prefixed classes?
No.
Q: Do you use AFNetworking or other frequently used Open Source software?
Every line of code in the SDK is under our control—while we do use Apple's Reachability source, the Reachability class is (now) prefixed with ST.
Q: Does the SDK use the iOS file system?
Yes, it mostly uses a single encrypted file, saved in the Application Support folder (path obtained from NSSearchPathForDirectoriesInDomains), but may create a second temporarily file. Each gets marked with the Do Not Backup attribute.
Q: Does the app ever use HTTP?
No, it only uses HTTPS.
Q: Does the .a file include symbols?
Yes, the app contains all symbols (to better guide crash analysis in the remote chance encounter an exception in our software). If you strip your app or create a separate symbol file the library symbols are managed by Xcode the same way.
Q: What is the code size of the library?
There is no simple answer to this - the library (.a file) has architectures lipo'd into it for all valid device and simulator architectures, and contains the full symbol table to assist in exception resolution. A Q&A on StackOverflow shows one technique you can use to determine the stripped size of one architecture. For the 3.3.0 library, arm64, the size is about 125,000 bytes (TEXT+DATA)
Q: What does Sailthru mean when it deprecates something?
That feature will likely be gone in the next release. Switch to using whatever the warning suggests.
For those of you that have both a web site and an iOS app, Apple introduced a new concept in iOS8 called Continuity. One aspect of that can facilitate app login, by leveraging Safari credentials. Sailthru has experimented with this technology, and we show how to do it on our tech blog.
Brenden Mulligan, co-founder and designer at Cluster, documented the approach on TechCrunch that his company uses to increase the percentage of users who allow push notifications etc. Definitely worth a read!
Copyright (c) 2014-2015 Sailthru, Inc