My build.settings looks like this:
settings =
{
plugins =
{
["CoronaProvider.native.popup.social"] =
{
publisherId = "com.coronalabs",
supportedPlatforms = { iphone=true, android=true }
},
["CoronaProvider.native.popup.activity"] =
{
publisherId = "com.coronalabs",
supportedPlatforms = { iphone=true}
},
["plugin.notifications.v2"] =
{
publisherId = "com.coronalabs"
},
["plugin.google.iap.billing.v2" ] =
{
publisherId = "com.solar2d"
},
['plugin.vibrator'] =
{
publisherId = 'com.fd'
},
['plugin.installerID'] =
{
publisherId = 'com.fd'
},
["plugin.gpgs"] = {
publisherId = "com.coronalabs",
supportedPlatforms = {android = true}
},
["CoronaProvider.gameNetwork.apple"] =
{
publisherId = "com.coronalabs",
supportedPlatforms = { iphone=true }
},
['plugin.att'] =
{
publisherId = 'com.solar2d'
},
["plugin.advertisingId"] =
{
publisherId = "com.coronalabs"
},
["plugin.ironSource"] =
{
publisherId="tech.scotth",
marketplaceId = "xxxxx",
},
["plugin.unityAdsIron"] = {
publisherId = "tech.scotth",
supportedPlatforms =
{
android = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=unityAds&type=Android" },
iphone = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=unityAds&type=iOS" },
},
},
["plugin.facebookIron"] = {
publisherId = "tech.scotth",
supportedPlatforms =
{
android = { url="http://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=facebook&type=Android" },
iphone = { url="http://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=facebook&type=iOS" },
},
},
["plugin.reviewPopUp"] =
{
publisherId="tech.scotth",
marketplaceId = "xxxxx",
},
['plugin.facebook.v4a'] = {
publisherId = 'com.coronalabs'
},
["plugin.applovinIron"] = {
publisherId = "tech.scotth",
supportedPlatforms =
{
android = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=applovin&type=Android" },
iphone = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=applovin&type=iOS" },
},
},
["plugin.adColonyIron"] = {
publisherId = "tech.scotth",
supportedPlatforms =
{
android = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=adColony&type=Android" },
iphone = { url="https://solar2dmarketplace.com/getShared?subFolder=ironsource&sharedName=adColony&type=iOS" },
},
},
["plugin.OneSignal"] =
{
publisherId = "com.onesignal",
},
['plugin.mixpanel'] =
{
publisherId = 'com.yogergames'
},
},
splashScreen =
{
enable = false
},
orientation =
{
-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
default = "portrait",
supported = { "portrait" }
},
excludeFiles =
{
-- Include only the necessary files on each platform, if "Icon.png" is for iphone then exclude it from android by adding it in the android table
-- excludes files from builds for a specific platforms
iphone = { "Icon-*dpi.png"},
android = { "Icon.png", "Icon-Small-*.png", "Icon*@2x.png" },
-- include only those files in this table which are to be excluded from all the platforms.
all = {"Calling points.docx", "hostage.JPG", "player.JPG", "zombie.JPG"},
},
--
-- Android Section
--
android =
{
usesPermissions =
{
"android.permission.INTERNET",
"android.permission.ACCESS_NETWORK_STATE",
"android.permission.GET_ACCOUNTS",
"com.android.vending.BILLING",
"android.permission.ACCESS_COARSE_LOCATION",
"android.permission.ACCESS_WIFI_STATE",
"com.google.android.gms.permission.AD_ID",
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.VIBRATE",
},
applicationChildElements =
{
--this meta data is being added because for network security android now only allows secure connections(via https, called cleartext) if app is trying to connect an external server/database etc.
--We need to opt out of supporting cleartext because our backend(app42) uses http protocol. To include more domains that opt of of this service, see the network_security_config.xml file.
[[
<meta-data android:name="networkSecurityConfig"
android:value="@xml/network_security_config"/>
]],
--below is for FB so that we can track app events and use those to run ads for this app on FB ads
[[
<provider android:authorities="com.facebook.app.FacebookContentProviderxxxx"
android:name="com.facebook.FacebookContentProvider" android:exported="true"/>
]],
[[
<meta-data android:name="xxxx"/>
]],
-- This is for the applovin max plugin
[[
<meta-data android:name="applovin.sdk.key" android:value="xxxxx"/>
]],
},
facebookAppId = "xxxxx",
googlePlayGamesAppId = "xxxxx",
useGoogleServicesJson = true,
minSdkVersion = "26", -- this version corresponds to Android 8
},
The script below is all the code that I have in my projects for accessing this plugin:
local oneSignalManager={}
local oneSignal=require("plugin.OneSignal")
local analytics=require "scripts.helperScripts.analytics"
local rewardCodeHandler=require "scripts.helperScripts.rewardCodeHandler"
local toast=require "scripts.helperScripts.toast"
----------------
local function DidReceiveRemoteNotification(message, additionalData, isActive)
if (additionalData) then--additional data is a table of KV pairs that can be passed in from the dashbaord when sending messages to devices
if (additionalData.rewardCode) then--if a rewardCode key was found in additional data, call necessary helper scripts to implement that reward code.
-- native.showAlert( "REWARD CODE", additionalData.rewardCode, { "OK" } )--this can be turned on for debug purposes
analytics.sendTrackingEvent("EnteredUsingNotification")
--perform necessary actions here for giving reward:
rewardCodeHandler.performActionByCode(additionalData.rewardCode)
end
else
native.showAlert("MESSAGE RECEIVED!", message, { "OK" } )--this will show an alert for a message that is received WHEN THE MESSAGE DOESN:T containt a reward code
end
end
---------------
--init- add in the project/app id from onesignal dashboard and the second argument is google project number
oneSignal.Init("xxxxx", "xxxxxx", DidReceiveRemoteNotification)
---------------
-- tag users as ios or android or test depending on their os or debugMode state to allow segmentation on dashboard.
-- if debug mode is on then make the device subscribe to the test segment. This can be used to test push notifications.
if (isDebugMode) then
oneSignal.SendTag("app", "test")
elseif( system.getInfo("platform") == "android" ) then
oneSignal.SendTag("os", "android")
else
oneSignal.SendTag("os", "ios")
end
return oneSignalManager