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.

abpetkov
  • 884
  • 5
  • 11
  • 29

4 Answers4

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.

Kevin Boyle
  • 457
  • 2
  • 7
  • Right. You can either create a [PhoneGap plugin](http://docs.phonegap.com/en/2.3.0/guide_plugin-development_ios_index.md.html#Developing%20a%20Plugin%20on%20iOS), or just use the UserVoice web interface. I know some people have used the [UserVoice SDK with PhoneGap before](https://github.com/uservoice/uservoice-iphone-sdk/issues/67), but it doesn't look like anyone has provided an opensource plugin for it. – Austin Taylor Feb 04 '13 at 17:39
0

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

surinder singh
  • 1,463
  • 13
  • 12
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.

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.

hammady
  • 969
  • 1
  • 13
  • 22