1

I want to a horizontal scrolling view(UIColectionView or iCarousal view) inside notification content extension but it is not scrolling.

I just added a simple collection view with 5 cells but it's loading only first cell and it's not scrolling. So is it possible to do or not?

Any help is appreciated in advance!!!!

Ashok
  • 180
  • 1
  • 7
  • I don't think this is possible. If you implement a `UNNotificationContentExtension` you can create a custom interface, however, the views do not recieve touches and cannot be interacted with (according to the WWDC 2016 Session 708 talk) – Dennis W. Jun 22 '17 at 03:05
  • This SDK https://github.com/blueshift-labs/Blueshift-iOS-SDK is using icarousel in content extension, I have not tested it, not sure how they are doing it. – Ashok Jun 23 '17 at 10:17
  • The documentation states "The system prevents the delivery of touch events to your view controller while it is onscreen. Do not install gesture recognizers or rely on touch events in your interface." I wonder if the extension in your link is for use on WatchOS as the `BlueShiftCarousalViewController` does not implement the `UNNotificationContentExtension` protocol which is required for notification extensions. – Dennis W. Jun 24 '17 at 02:27
  • Yes as per doc, touch events are not allowed. I tried in sample and I'm not getting any touch event call backs on my view controller. I was going through this BlueShiftSDK code and they are doing autoscroll in icarousal and for touch actions, two buttons added Next and Previous using UNNotificationAction. Based on these actions icarousal is scrolled to next index or previous index. – Ashok Jun 24 '17 at 07:22
  • Hi Ashok did you find answer to your question? – Pulkit Kumar Singh Feb 23 '18 at 11:01

1 Answers1

0

You need to add Userintercation Enabled Under NSExtensionAttributes in your Notification Content Extension Info pList File.

<dict>
            <key>UNNotificationExtensionCategory</key>
            <string>carousel</string>
            <key>UNNotificationExtensionDefaultContentHidden</key>
            <false/>
            <key>UNNotificationExtensionInitialContentSizeRatio</key>
            <real>1</real>
            <key>UNNotificationExtensionUserInteractionEnabled</key>
            <true/>
        </dict>