Helpshift Plugin
This plugins allows you access Helpshift for player support for faq and contact support.
Limitations: Only works on Android and iOS.
Functions:
helpshift.init(API_KEY, DOMAIN, APP_ID)
local helpshift = require("plugin.helpshift") | |
helpshift.init("API_KEY", "DOMAIN","APP_ID") |
helpshift.showFaqs(params)
params(optional)(table)
you can find all configration params here
helpshift.showConversation(params)
params(optional)(table)
you can find all configration params here
helpshift.showFaqSection(section,params)
section(required)(string) show faqs from a particular FAQ section.
params(optional)(table)
you can find all configration params here
helpshift.registerDeviceToken(token)
token(required)(string) push notfication token from device
Check out Corona's guide on handing notfication
Check out this sample for Registering Device:
local notifications = require( "plugin.notifications" ) | |
notifications.registerForPushNotifications() | |
local json = require("json") | |
local function notificationListener( event ) | |
if ( event.type == "remoteRegistration" ) then | |
helpshift.registerDeviceToken(event.token) | |
else -- handle data | |
print( json.prettify( event.custom)) | |
end | |
end | |
local launchArgs = ... | |
if ( launchArgs and launchArgs.notification ) then | |
notificationListener( launchArgs.notification ) | |
end | |
Runtime:addEventListener( "notification", notificationListener ) |
helpshift.getNotificationCount()-- returns interger for number of notfications
Make sure push notfication are setup in your account to send notfication
Build Settings:
settings = | |
{ | |
android = | |
{ | |
permissions = | |
{ | |
{ name = ".permission.C2D_MESSAGE", protectionLevel = "signature" }, | |
}, | |
usesPermissions = | |
{ | |
"android.permission.INTERNET", | |
"android.permission.GET_ACCOUNTS", | |
"android.permission.RECEIVE_BOOT_COMPLETED", | |
"com.google.android.c2dm.permission.RECEIVE", | |
".permission.C2D_MESSAGE", | |
}, | |
}, | |
plugins = | |
{ | |
["plugin.notifications"] = | |
{ | |
publisherId = "com.coronalabs" | |
}, | |
["plugin.helpshift"] = | |
{ | |
publisherId="tech.scotth", | |
marketplaceId = "insert marketplace account ID", | |
}, | |
}, | |
} |