CocoaPods के साथ InboxUI सेट अप करें
-
अपने प्रोजेक्ट डायरेक्टरी में टर्मिनल से ‘pod init’ कमांड चलाएँ।
-
नई बनाई गई Podfile खोलें।
-
अपने प्रोजेक्ट नाम टारगेट के तहत Pushwoosh डिपेंडेंसी जोड़ें:
# Uncomment the next line to define a global platform for your project# platform: ios, ‘9.0’
target ‘MyApp’ do # Comment the next line if you don’t want to use dynamic frameworks use_frameworks!
# Pods for MyApp pod 'PushwooshInboxUI'
end- अपने प्रोजेक्ट डायरेक्टरी में टर्मिनल में निम्नलिखित कमांड चलाएँ:
pod install-
नई बनाई गई <your_project_name>** .xcworkspace** फ़ाइल खोलें।
-
बहुत अच्छे! आपने अभी-अभी Pushwoosh InboxUI को अपने प्रोजेक्ट में इंटीग्रेट किया है।
Pushwoosh InboxUI कोड जोड़ें
Anchor link toअपने ऐप में Inbox UI दिखाने के लिए, Inbox व्यू कंट्रोलर जोड़ें:
self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle defaultStyle]] animated:YES];Inbox को अपने ऐप की उपस्थिति से मेल खाने के लिए, PWIInboxStyle के पैरामीटर बदलें। आप फ़ॉन्ट, बैकग्राउंड कलर आदि जैसे पैरामीटर को कस्टमाइज़ कर सकते हैं।
//creating a new Inbox stylelet 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 stylePWIInboxStyle *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 error message");
[PWIInboxStyle setupDefaultStyle:inboxStyle];कस्टमाइज़ेशन
Anchor link toInbox UI स्टाइल को कस्टमाइज़ करने के लिए, कृपया देखें:
अधिक जानकारी के लिए, Inbox Sample देखें।