How to implement Notification Image part in IOS from the official documentation in swift code instead of C

173

Judging by the Firebase swift documentation it should probably look something like this:

Messaging.serviceExtension().populateNotificationContent(self.bestAttemptContent, withContentHandler: contentHandler)
Share:
173
Ziyad Mansy
Author by

Ziyad Mansy

I’m an experienced mobile app developer who has a track record of success creating apps that are both well-received and commercially viable. Skilled with working as a team and incorporating input into projects. Ability to always look for ways to improve upon an already existing app to keep people downloading it and enjoying it. Strong eye for detail and tenacity to never quit on something until it is absolutely perfect.

Updated on December 20, 2022

Comments

  • Ziyad Mansy
    Ziyad Mansy over 1 year

    I'm trying to implement the last part in the notification image in apple notifications integration here

    This is the C Code in the documentation:

    - // Modify the notification content here...
    - self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];
    
    - self.contentHandler(self.bestAttemptContent);
    + [[FIRMessaging extensionHelper] populateNotificationContent:self.bestAttemptContent withContentHandler:contentHandler];
    

    I want to convert it to swift code so i can use it in my Project ImageNotification.swift