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 ‘MyApp’ do # Kommentieren Sie die nächste Zeile aus, wenn Sie keine dynamischen Frameworks verwenden möchten use_frameworks!
# Pods für MyApp pod 'PushwooshInboxUI'
end4. Führen Sie den folgenden Befehl in Ihrem Terminal in Ihrem Projektverzeichnis aus:
pod install5. Ö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 toUm 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)[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle defaultStyle]] animated:YES];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-Stilslet 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)// Erstellen eines neuen Inbox-StilsPWIInboxStyle *inboxStyle = [PWIInboxStyle customStyleWithDefaultImageIcon:[UIImage imageNamed:@"custom_image"]textColor:UIColor.darkTextColoraccentColor:UIColor.blueColorfont:[UIFont systemFontOfSize:17]];
inboxStyle.backgroundColor = [UIColor colorWithWhite:1 alpha:1];inboxStyle.listErrorMessage = NSLocalizedString(@"Custom error message", @"Custom error message");inboxStyle.listEmptyMessage = NSLocalizedString(@"Custom empty message", @"Custom empty message");
[PWIInboxStyle setupDefaultStyle:inboxStyle];Anpassung
Anchor link toInformationen zur Anpassung des Inbox-UI-Stils finden Sie unter:
Weitere Details finden Sie im Inbox-Beispiel.