0

Recently I am working on a project and it has a requirement to embed rich notification. So I am taking service from firebase. Initially I have tried from these sites. and there are some hobby projects in youtube where they send notification from local machine.

https://www.avanderlee.com/ios-10/rich-notifications-ios-10/

UNNotificationAttachment with UIImage or Remote URL

How to implement rich notifications in ios 10 with Firebase

How to send Image with firebase Push Notification using swift 3

But almost 16 hours I spent on it. It gave me 0 output because Title,sub-title came from firebase finely but there is no sign of image icon.

Please suggest me any approach or good video or something.

KhanShaheb
  • 714
  • 2
  • 11
  • 26

1 Answers1

0

Your App target's plist should contain following lines

<key>NSExtensionPointIdentifier</key> 
<string>com.apple.usernotifications.service</string> 
<key>NSExtensionPrincipalClass</key> 
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>

And Your extension's plist should look like following

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>RemotePushExtension</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>XPC!</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1.12</string>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    <key>NSExtension</key>
    <dict>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.usernotifications.service</string>
        <key>NSExtensionPrincipalClass</key>
        <string>NotificationService</string>
    </dict>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Want to access your photo album to save image</string>
</dict>
</plist>