1

I have this iOS Phonegap application and I need to integrate UserVoice. I follow this tutorial and I have reached to the point I have to make the configuration. I am really not sure where I have to put that object UserVoice are providing me with:

UVConfig *config = [UVConfig configWithSite:@"YOUR_USERVOICE_URL"
                                 andKey:@"YOUR_KEY"
                              andSecret:@"YOUR_SECRET",
                            andSSOToken:@"SOME_BIG_LONG_SSO_TOKEN"];

I'll appreciate some help with that, since I'm really on a beginner level with iOS apps in general. Thanks in advance.

4

4 回答 4

2

The code you posted comes from the UserVoice for iOS SDK which gives you the libraries and code necessary to include UserVoice in a native iOS app and will not work with a PhoneGap app.

Your options are to write a PhoneGap plugin, in Obj-C, to expose the UserVoice library, or possibly a better option is simply to open your UserVoice page within your PhoneGap app using the InAppBrowser plugin.

于 2013-02-04T11:03:01.860 回答
0

Here is a simple phonegap plugin http://developerextensions.com/index.php/cordova-phonegap-plugin-uservoice

于 2013-02-05T18:07:51.337 回答
0

I took the code from here: http://developerextensions.com/index.php/cordova-phonegap-plugin-uservoice and followed their instructions.

There were some additional things I needed to do:

  1. edit the config.xml and add the feature UserVoiceCommand

  2. edit the .js file and replace Ext.emptyFn with function(){}:

    cordova.exec(function(){}, function(){}, "UserVoiceCommand", "launch", [config]);

(those are the success and failure callback, which I intend to implement as well)

Since it was not functioning correctly on iOS7, I cloned https://github.com/uservoice/uservoice-ios-sdk, compiled it by running ./build.sh and then overwritten the files that came with the plugin.

于 2013-12-23T13:08:46.390 回答
0

You can now get iOS+Android support from this new cordova plugin:

https://github.com/Resgrid/cordova-plugins-uservoice

P.S. I am not affiliated to this plugin by any means, just came across it.

于 2016-05-10T05:17:07.513 回答