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:

# Kommentieren Sie die nächste Zeile aus, um eine globale Plattform für Ihr Projekt zu definieren
# platform: ios, ‘9.0’
target ‘MyAppdo
# Kommentieren Sie die nächste Zeile aus, wenn Sie keine dynamischen Frameworks verwenden möchten
use_frameworks!
# Pods für MyApp
pod 'PushwooshInboxUI'
end

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

pod install

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

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

Pushwoosh InboxUI-Code hinzufügen

Anchor link to

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

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

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

// Erstellen eines neuen Inbox-Stils
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)

Informationen zur Anpassung des Inbox-UI-Stils finden Sie unter:

Weitere Details finden Sie im Inbox-Beispiel.