Onesignal-ios-sdk: Unable to build for deployment target ios 9.0

Created on 23 Sep 2017  路  9Comments  路  Source: OneSignal/OneSignal-iOS-SDK

Following the step-by-step guide for the iOS SDK, I can get everything up and running as long as deployment targets are >10, but as soon as I put it to 9.0, I start getting the following kind of error:

'UNNotificationRequest' is only available on iOS application extension 10.0 or newer
and I'm forced to add >@available(iOSApplicationExtension 10.0, *)

so it can build.
How can I provide support for the iOS9 devices without denying them Push Notifications altogether? I'm assuming this is partly due to the fact that iOS10 has the Rich Notifications system.

Most helpful comment

If you are following the guide precisely, you have added a notification service extension to your project. That extension's deployment target must be at least 10.0, but you can set your application project to 9.0 separately, and both versions will work fine.

All 9 comments

If you are following the guide precisely, you have added a notification service extension to your project. That extension's deployment target must be at least 10.0, but you can set your application project to 9.0 separately, and both versions will work fine.

@aravasio Vzsg's answer should fix the error your are seeing. Feel free to reopen the issue if this doesn't help.

how to implement for ios 9?

@lexuanquynh I鈥檓 not sure what you are asking....?

@vzsg so by setting my extension's deployment target to 8.0, do I still need to add API_AVAILABLE(ios(10.0)) (as suggested by XCode) in order by to silence the warning?

No, the extension must have the deployment target set to 10.0 (or above). Notification Service Extensions appeared in that iOS version.

What I meant was that the _application project_ (== the iOS target) can have a lower deployment target.

@vzsg Thank you for the clarification. So for users below iOS 10, they can still receive push notifications, it's just that we would not be able to show image and action buttons in notifications?

That's right, those extras will not be available in the Notification Center, but it will work at a basic level still.

@vzsg is there a list of things one gains if the app's deployment target is 9.0 and IS bumped to 10.0? You just mentioned two here: show images and action buttons as part of a notification. We are debating whether to bump ours up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huahengling picture huahengling  路  5Comments

dirkoswanepoel picture dirkoswanepoel  路  5Comments

adambolcsfoldi picture adambolcsfoldi  路  4Comments

halilyuce picture halilyuce  路  3Comments

Tavernari picture Tavernari  路  4Comments