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 empty message");
[PWIInboxStyle setupDefaultStyle:inboxStyle];अनुकूलन
Anchor link toInbox UI शैली को अनुकूलित करने के लिए, कृपया देखें:
अधिक जानकारी के लिए, Inbox Sample देखें।