helpshift / CocoaPods

CocoaPods specs for Helpshift SDK
1 stars 0 forks source link

Issues with theming #2

Closed jyounus closed 8 years ago

jyounus commented 8 years ago

Hey there,

I've started to implement HelpShift into my app. I'm having trouble with the theming/skinning part now.

I've copied the dark theme plist into the root of my project. I renamed it to "HelpshiftConfig.plist". I made sure it's inside the "Copy Bundle Resources" project setting.

I found this inside the "Troubleshooting" docs: https://developers.helpshift.com/ios/troubleshooting/#skinning

Inside my AppDelegate, I added the following code:

let filePath = NSBundle.mainBundle().pathForResource("HelpshiftConfig", ofType: "plist")
print("filePath: \(filePath)")

And the response it prints to the console:

filePath: Optional("/Users/jayy/Library/Developer/CoreSimulator/Devices/5DB4E2D2-DE94-4911-B743-E231976BBD0A/data/Containers/Bundle/Application/CC7D4021-CCE8-4518-9315-BC91D9966E0A/xxx.app/HelpshiftConfig.plist")

So looks like everything is set up fine, however here's a screenshot of what the FAQ/Contact us screen looks like: https://abload.de/img/simulatorscreenshot5jfwsee.png

I have some UIAppearance related code that I set before initialising Helpshift, which according to the documentation should get overriden by the plist values. But it doesn't seem to work. It just won't change my app to show a dark theme for the FAQ section. I also tried to comment out all the UIAppearance code to see if that makes a difference, however I still see the same as in the screenshot (except the button colours are blue instead of white, which I set using the UIAppearance api). So it must be a different issue, it seems like it's not picking up my config plist file for some reasons.

I'm obviously using CocoaPods for this. pod 'Helpshift', '5.6.1' My project is for iOS 8 & 9, written in Swift.

Any help with this would be appreciated. Thanks.

jyounus commented 8 years ago

Figured it out. For anyone who might have a similar issue in the future:

In the documentation for Cocoapods, when it says Navigate to the Pods/ folder in your project directory. Add the HelpshiftConfig.plist from Pods/Helpshift/helpshift-ios-x.x.x/HSThemes/ to your project. ignore that step. Don't copy anything. You're supposed to modify the "HelpshiftConfig.plist" inside the Pods folder.

Don't do what I did and interpret the documentation wrong by copying the HelpshiftConfig.plist file into the root of your Xcode project (outside the Pods section). It won't pick it up.

Suggestion to the Helpstack team: When you initialise the SDK in the app delegate, maybe add a new key where it takes a file path to a custom plist file. This way every time the pod is updated, it won't reset my custom theme settings, because I will have my custom plist file stored inside of the root of my project somewhere.

So something like this:

let filePath = NSBundle.mainBundle().pathForResource("MyHelpshiftTheme", ofType: "plist")!
HelpshiftCore.installForApiKey("xxx", domainName: "xxx", appID: "xxx", withOptions: ["themeFilePath": filePath])