Skip to content

Commit

Permalink
update iOS plugin;
Browse files Browse the repository at this point in the history
fix add_inbox_ios_resources.js script
  • Loading branch information
Nikolay Galizin committed Apr 3, 2019
1 parent 38fccc8 commit 2ae222f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/add_inbox_ios_resources.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const config = require('react-native/local-cli/core/config');
require('react-native/setupBabel')();

const core = require('react-native/local-cli/core');
const PbxFile = require('xcode/lib/pbxFile');
const path = require('path');
const xcode = require('xcode');
const fs = require('fs');
const createGroupWithMessage = require('react-native/local-cli/link/ios/createGroupWithMessage');

function pwAddInboxiOSResources() {
const iOSconfig = config.getProjectConfig().ios;
core.configPromise.then(function(config) {
const iOSconfig = config.getProjectConfig().ios;
const pw_iOSconfig = config.getDependencyConfig('pushwoosh-react-native-plugin').ios;

const project = xcode.project(iOSconfig.pbxprojPath).parseSync();
Expand All @@ -31,6 +34,9 @@ function pwAddInboxiOSResources() {
iOSconfig.pbxprojPath,
project.writeSync()
);
});


};

pwAddInboxiOSResources();
18 changes: 18 additions & 0 deletions src/ios/PushwooshPlugin/Pushwoosh.m
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,24 @@ - (PWIInboxStyle *)inboxStyleForDictionary:(NSDictionary *)styleDictionary {
style.separatorColor = [RCTConvert UIColor:dividerColorValue];
}

NSNumber *barBackgroundColor = styleDictionary[@"barBackgroundColor"];

if (barBackgroundColor) {
style.barBackgroundColor = [RCTConvert UIColor:barBackgroundColor];
}

NSNumber *barAccentColor = styleDictionary[@"barAccentColor"];

if (barAccentColor) {
style.barAccentColor = [RCTConvert UIColor:barAccentColor];
}

NSNumber *barTextColor = styleDictionary[@"barTextColor"];

if (barTextColor) {
style.barTextColor = [RCTConvert UIColor:barTextColor];
}

return style;
}

Expand Down

0 comments on commit 2ae222f

Please sign in to comment.