Zum Inhalt springen

InboxUI mit CocoaPods einrichten

1. Führen Sie den Befehl ‘pod init’ im Terminal in Ihrem Projektverzeichnis aus.

2. Öffnen Sie die neu erstellte Podfile.

3. Fügen Sie die Pushwoosh-Abhängigkeit unter dem Ziel Ihres Projektnamens hinzu:

# Uncomment the next line to define a global platform for your project
# platform: ios, ‘9.0’
target ‘MyAppdo
# Comment the next line if you don’t want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'PushwooshInboxUI'
end

4. Führen Sie den folgenden Befehl im Terminal in Ihrem Projektverzeichnis aus:

pod install

5. Öffnen Sie die neu erstellte <Ihr_Projektname>.xcworkspace-Datei.

6. Gut gemacht! Sie haben Pushwoosh InboxUI erfolgreich in Ihr Projekt integriert.

Pushwoosh InboxUI-Code hinzufügen

Anchor link to

Um die Inbox UI in Ihrer App anzuzeigen, fügen Sie den Inbox-View-Controller hinzu:

self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)

Um den Posteingang an das Erscheinungsbild Ihrer App anzupassen, ändern Sie die Parameter von PWIInboxStyle. Sie können Parameter wie Schriftart, Hintergrundfarbe usw. anpassen.

//creating a new Inbox style
let inboxStyle = PWIInboxStyle.customStyle(withDefaultImageIcon: UIImage.init(named: "custom_image"),
textColor: UIColor.darkText,
accentColor: UIColor.blue,
font: UIFont.systemFont(ofSize: 17))
inboxStyle?.backgroundColor = UIColor.init(white: 1, alpha: 1)
inboxStyle?.listErrorMessage = NSLocalizedString("Custom error message", comment: "Custom error message")
inboxStyle?.listEmptyMessage = NSLocalizedString("Custom empty message", comment: "Custom empty message")
PWIInboxStyle.setupDefaultStyle(inboxStyle)

Um den Stil der Inbox UI anzupassen, beachten Sie bitte:

Weitere Details finden Sie im Inbox-Beispiel.