Skip to content

Pushwoosh/pushwoosh-inbox-ui-ios-sdk

Repository files navigation

Pushwoosh Inbox UI

GitHub release CocoaPods compatible Carthage compatible

How To Get Started

Communication

  • If you need help, use Stack Overflow. (Tag 'pushwoosh')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, and can provide steps to reliably reproduce it, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation

PushwooshInboxUI supports multiple methods for installing the library in a project.

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like PushwooshInboxUI in your projects. See the "Getting Started" guide for more information. You can install it with the following command:

$ gem install cocoapods

CocoaPods 0.39.0+ is required to build PushwooshInboxUI 5.5.0+.

Podfile

To integrate PushwooshInboxUI into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'

target 'TargetName' do
pod 'PushwooshInboxUI', '~> 5.5'
pod 'Pushwoosh', '~> 5.5'
end

Then, run the following command:

$ pod install

Installation with Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate PushwooshInboxUI into your Xcode project using Carthage, specify it in your Cartfile:

github "Pushwoosh/pushwoosh-inbox-ui-ios-sdk" ~> 5.5

Run carthage to build the framework and drag the built PushwooshInboxUI.framework into your Xcode project.

Implementation

To show Inbox UI in your app you can just add Inbox view controller:

Swift

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

Objective-C

[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle  defaultStyle]] animated:YES];

To make the Inbox match your app's look change parameters of PWIInboxStyle. You can customize such parameters as font, background color, etc.

Swift

//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)

Objective-C

//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];

Customization

To customize Inbox UI style, please see:
PWIInboxStyle.h
and
PWIInboxUI.h

For more details, take a look at Inbox sample.

Change Log

See this repository's release tags for a complete change log of every released version.

License

PushwooshInboxUI is released under the MIT license. See LICENSE for details.