Set up InboxUI with Carthage
iOS Setup With Carthage
1. Open project directory in terminal. Run the following command:
echo 'github "Pushwoosh/pushwoosh-inbox-ui-ios-sdk"' >> Cartfile
2. Run the following command:
carthage update --use-xcframeworks --platform iOS
3. Open your Xcode project.
4. Go to your application targets "General" settings tab, "Frameworks, Libraries, and Embedded Content" section.
5. Drag and drop PushwooshInboxUI.xcframework from <Your Project Directory>/Carthage/Build folder on disk.
If an error occurs, use a workaround – setting Validate Workspace to Yes in the Build Settings tab
6. That's it!
To show Inbox UI in your app, add the Inbox view controller:
Swift
Objective-C
self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)
[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle defaultStyle]] animated:YES];
To make the Inbox match your app's appearance, change the parameters of
PWIInboxStyle
. You can customize such parameters as font, background color, etc.Swift
Objective-C
//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)
//creating a new Inbox style
PWIInboxStyle *inboxStyle = [PWIInboxStyle customStyleWithDefaultImageIcon:[UIImage imageNamed:@"custom_image"]
textColor:UIColor.darkTextColor
accentColor:UIColor.blueColor
font:[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];
To customize Inbox UI style, please refer to:
Your feedback helps us create a better experience, so we would love to hear from you if you have any issues during the SDK integration process. If you face any difficulties, please do not hesitate to share your thoughts with us via this form.
Last modified 1yr ago