Getting Started iOS

Cocos2d-x plugin for Helpshift SDK helps you utilize Helpshift from your game's C++ codebase.

Requirements

  • Xcode 10.2 and above.
  • Supported iOS versions:
    • iOS 14 Developer Beta, 13, 12, 11 and 10

With version 5.0.0 (SDK version 7.5.3), Helpshift SDK has dropped support for iOS 9. If you wish to keep supporting iOS 9 devices for your apps, please read the KB Article to support Helpshift on older OS versions.

If you have a project with Xcode version prior to Xcode 9, you could use the build mentioned here.

Download the Cocos2d-x plugin for Helpshift

Helpshift Cocos2d-x package comes in two variants:

1. Standard SDK - In-app Customer Service

Download SDK v5.4.0

2. Campaigns-enabled SDK - Proactive In-app Customer Service

Download SDK v5.4.0-withCampaigns

The zip file contains:

v3.x
Folder containing the files for Cocos2dx version 3.x
v2.x
Folder containing the files for Cocos2dx version 2.x

Adding the Helpshift iOS plugin

  • Unzip the package, add the contents of the ios/Classes folder into your Xcode project.
  • From ios/sdk folder drag & drop Helpshift.framework into your cocos Xcode project.
  • In Build Phases of your app target, verify that Helpshift.framework is in the Link Binary with Libraries section.
  • In Build Phases of your app target, add a new Copy Files section. Set it’s Destination to Frameworks and add Helpshift.Framework to this section.
  • In Build Phases of your app target, add a new Run Script phase. Ensure this build phase falls after the Copy Files phase. Copy paste the following in the script text box:
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Helpshift.framework/strip_frameworks.sh"
  • After successful integration, Build Phases should look like this:    show me
  • If your app does not contain any swift code, set Always Embed Swift Standard Libaries under Build Settings to YES.
  • In the Build Settings of your Xcode project add @loader_path/Frameworks flag under Runpath Search Paths section.
  • In the Build Settings of your Xcode project, add -fmodules and -fcxx-modules flags under the Other C Flags section in both Debug and Release. Be careful while adding these flags in Debug and Release, because if you override the default flags you might face build errors. The Other C Flags section would look this after adding mentioned flags:    show me

While building Xcode project if you are facing an error stating "Helpshift module not found" then please check again if you have integrated Helpshift.framework correctly as mention above. And then check if Xcode has identified and correctly added path in 'Framework Search Paths' section where you have placed Helpshift.framework in your project, if not please add it.

If you want to compile your Xcode project with bitcode enabled, please use Helpshift.framework present under 'ios/sdk/Bitcode' folder.

  • With version 5.3.0, End-users will be able to send files such as pdf, video, etc. where before 5.3.0 end-users could only send images. For iOS 10 and below, to access files in the “Files” app of iOS, developers will need to add iCloud capability with iCloud Documents services enabled. For more info please refer the Prerequisites section here.    show me

Add NSPhotoLibraryUsageDescription key in your application info plist file

If your app does not use this permission, you would need to add this key as well as description for the same. Not adding this key-description pair might cause app rejection.

Description text: “We need to access photos library to allow users manually pick images meant to be sent as attachment for help and support reasons.”

Note that this is just a suggested description. If you need localisations for the same, please Contact Us

Please replace all the old files with new files.

Initializing Helpshift in your App

Helpshift SDK uniquely identifies your App with the combination of:

API Key
Your unique developer API Key.
Domain Name
Your Helpshift domain name. For example : foo.helpshift.com
App ID
A unique ID assigned to your app.

To get the API Key, Domain Name and the App ID, navigate to Settings>SDK (for Developers) in your agent dashboard and scroll down to "Initializing Helpshift" section. show me

Select your App from the dropdown and copy the three tokens to be passed when initializing Helpshift.

Initialize Helpshift by including HelpshiftCocos2dx.h and calling HelpshiftCocos2dx::install in the AppDelegate::applicationDidFinishLaunching() function of your AppDelegate.cpp:

#include "HelpshiftCocos2dx.h"
...

bool AppDelegate::applicationDidFinishLaunching() {

    HelpshiftCocos2dx::install("<YOUR_API_KEY>",
                               "<YOUR_HELPSHIFT_DOMAIN>.helpshift.com",
                               "<YOUR_APP_ID>");
    ...

}

Start using Helpshift

Helpshift is now integrated in your app. You should now use the support APIs to present FAQ or conversation screens inside your app.

Run your app, and try starting a test conversation using the showConversation API call. Then goto your Helpshift agent dashboard and reply to experience the in-app messaging.

Sample usage for FAQs and conversation APIs:

// Presenting FAQs to your customers
void GameSettingsScene::menuHelpCallback(CCObject* pSender)
{
    HelpshiftCocos2dx::showFAQs();
}

// Starting a conversation with your customers
void GameSettingsScene::menuConversationCallback(CCObject* pSender)
{
    HelpshiftCocos2dx::showConversation();
}

Next up

Helpshift APIs

Discover ways to do customer support via Helpshift.

Notifications

Configure Push and In-app notifications.

Tracking

Track events and user actions. Attach custom metadata to every conversation.

Reviews & Feedback

Asking for reviews and feedback.