C# Class SpilGames.Unity.Implementations.SpiliOSUnityImplementation

Inheritance: SpilUnityImplementationBase
Mostrar archivo Open project: spilgames/spil_event_unity_plugin

Protected Properties

Property Type Description
disableAutomaticRegisterForPushNotifications bool

Public Methods

Method Description
AddCurrencyToWallet ( int currencyId, int amount, string reason ) : void
AddItemToInventory ( int itemId, int amount, string reason ) : void
BuyBundle ( int bundleId, string reason ) : void
ClosedParentalGate ( bool pass ) : void

Call to inform the SDK that the parental gate was (not) passes

ConsumeBundle ( int bundleId, string reason ) : void
DisableAutomaticRegisterForPushNotifications ( ) : void

Disables the automatic register for push notifications. Should be called before SpilInit!

GetConfigAll ( ) : string

Returns the game config as a json string. This is not essential for developers so could be made private (getConfig() uses it so it cannot be removed entirely) but might be handy for some developers so we left it in.

GetConfigValue ( string key ) : string

Method that returns a configuration value from the game config based on key

GetInvetoryFromSdk ( ) : string
GetOtherUsersGameState ( string provider, string userIdsJsonArray ) : void

Gets the public game state of other users.

GetPrivateGameState ( ) : string

Gets the state of the private game.

GetPublicGameState ( ) : string

Gets the public game state.

GetSpilGameDataFromSdk ( ) : string
GetSpilUserId ( ) : string

Retrieves the Spil User Id so that developers can show this in-game for users. If users contact Spil customer service they can supply this Id so that customer support can help them properly. Please make this Id available for users in one of your game's screens.

GetUserId ( ) : string

Retrieves the custom User Id

GetUserProvider ( ) : string

Gets the user provider.

GetWalletFromSdk ( ) : string
PlayMoreApps ( ) : void

This can be called to show the "more apps" activity, for instance after calling "RequestMoreApps()" and receiving an "AdAvailable" event the developer could call this method from the event handler. When calling this method "RequestMoreApps()" must first have been called to request and cache a video. If no video is available then nothing will happen.

PlayVideo ( ) : void

This can be called to show a video, for instance after calling "SendrequestRewardVideoEvent()" and receiving an "AdAvailable" event the developer could call this method from the event handler. When calling this method "SendrequestRewardVideoEvent()" must first have been called to request and cache a video. If no video is available then nothing will happen.

RegisterForPushNotifications ( ) : void

Registers for push notifications for iOS. Can be used then the automatic registration was disabled using: DisableAutomaticRegisterForPushNotifications();

RequestDailyBonus ( ) : void
RequestMoreApps ( ) : void

Sends the "requestAd" event with the "moreApps" parameter to the native Spil SDK which will send a request to the back-end. When a response has been received from the back-end the SDK will fire either an "AdAvailable" or and "AdNotAvailable" event to which the developer can subscribe and for instance call PlayVideo(); or PlayMoreApps();

RequestSplashScreen ( ) : void
SendCustomEvent ( string eventName, object>.Dictionary dict ) : void

Sends an event to the native Spil SDK which will send a request to the back-end. Custom events may be tracked as follows: To track an simple custom event, simply call Spil.Instance.SendCustomEvent(String eventName); from anywhere in your code. To pass more information with the event create a <String, String> Dictionary and pass that as the second parameter like so: Dictionary<String, String> eventParams = new Dictionary<String,String>(); eventParams.Add(“level”,levelName); Spil.Instance.SendCustomEvent(“PlayerDeath”, eventParams); See https://github.com/spilgames/spil_event_unity_plugin for more information on events. This method was previously called "TrackEvent".

SendCustomEvent ( string eventName, string>.Dictionary dict ) : void

Sends an event to the native Spil SDK which will send a request to the back-end. Custom events may be tracked as follows: To track an simple custom event, simply call Spil.Instance.SendCustomEvent(String eventName); from anywhere in your code. To pass more information with the event create a <String, String> Dictionary and pass that as the second parameter like so: Dictionary<String, String> eventParams = new Dictionary<String,String>(); eventParams.Add(“level”,levelName); Spil.Instance.SendCustomEvent(“PlayerDeath”, eventParams); See https://github.com/spilgames/spil_event_unity_plugin for more information on events. This method was previously called "TrackEvent".

SetCustomBundleId ( string bundleId ) : void
SetPluginInformation ( string PluginName, string PluginVersion ) : void
SetPrivateGameState ( string privateData ) : void

Sets the state of the private game.

SetPublicGameState ( string publicData ) : void

Sets the public game state.

SetShowToastOnVideoReward ( bool value ) : void

When Fyber has shown a reward video and the user goes back to the game to receive his/her reward Fyber can automatically show a toast message with information about the reward, for instance "You've received 50 coins". This is disabled by default to allow the developer to create a reward notification for the user. Developers can call SetShowToastOnVideoReward(true) to enable Fyber's automatic toast message.

SetUserId ( string providerId, string userId ) : void

Sets the custom User Id for a provider

ShowContactCenter ( ) : void
ShowHelpCenter ( ) : void
ShowHelpCenterWebview ( ) : void
SubtractCurrencyFromWallet ( int currencyId, int amount, string reason ) : void
SubtractItemFromInventory ( int itemId, int amount, string reason ) : void
TestRequestAd ( string providerName, string adType, bool parentalGate ) : void

Method that initiaties a Test Ad. This is not essential for developers so could be hidden but it might be handy for some developers so we left it in.

UpdatePackagesAndPromotions ( ) : void

Method that requests packages and promotions from the server. This is called automatically by the Spil SDK when the game starts. This is not essential so could be removed but might be handy for some developers so we left it in.

UpdatePlayerData ( ) : void

Protected Methods

Method Description
GetAllPackages ( ) : string
GetPackage ( string key ) : string

Private Methods

Method Description
CheckForRemoteNotifications ( ) : void
OnApplicationPause ( bool pauseStatus ) : void
SendNotificationTokenToSpil ( ) : void
SpilInit ( ) : void

This method is marked as internal and should not be exposed to developers. The Spil Unity SDK is not packaged as a seperate assembly yet so this method is currently visible, this will be fixed in the future. Internal method names start with a lower case so you can easily recognise and avoid them.

addCurrencyToWalletNative ( int currencyId, int amount, string reason ) : void
addItemToInventoryNative ( int itemId, int amount, string reason ) : void
applicationDidBecomeActive ( ) : void
applicationDidEnterBackground ( ) : void
buyBundleNative ( int bundleId, string reason ) : void
closedParentalGateNative ( bool pass ) : void
consumeBundleNative ( int bundleId, string reason ) : void
devRequestAdNative ( string providerName, string adTypeName, bool parentalGate ) : void
disableAutomaticRegisterForPushNotificationsNative ( ) : void
getAllPackagesNative ( ) : string
getConfigNative ( ) : string
getConfigValueNative ( string keyName ) : string
getInventoryNative ( ) : string
getOtherUsersGameStateNative ( string provider, string userIdsJsonArray ) : void
getPackageNative ( string keyName ) : string
getPrivateGameStateNative ( ) : string
getPromotion ( string key ) : string

This method is marked as internal and should not be exposed to developers. The Spil Unity SDK is not packaged as a seperate assembly yet so this method is currently visible, this will be fixed in the future. Internal method names start with a lower case so you can easily recognise and avoid them.

getPromotionNative ( string keyName ) : string
getPublicGameStateNative ( ) : string
getSpilGameDataNative ( ) : string
getSpilUserIdNative ( ) : string
getUserIdNative ( ) : string
getUserProviderNative ( ) : string
getWalletNative ( ) : string
handlePushNotification ( string notificationStringParams ) : void
initEventTrackerWithOptions ( string options ) : void
playRewardVideoNative ( ) : void
registerForPushNotifications ( ) : void
requestDailyBonusNative ( ) : void
requestPackagesNative ( ) : void
requestSplashScreenNative ( ) : void
setCustomBundleIdNative ( string bundleId ) : void
setPluginInformationNative ( string pluginName, string pluginVersion ) : void
setPrivateGameStateNative ( string privateData ) : void
setPublicGameStateNative ( string publicData ) : void
setPushNotificationKey ( string key ) : void
setUserIdNative ( string providerId, string userId ) : void
showContactCenterNative ( ) : void
showHelpCenterNative ( ) : void
showHelpCenterWebviewNative ( ) : void
showMoreAppsNative ( ) : void
showToastOnVideoReward ( bool show ) : void
subtractCurrencyFromWalletNative ( int currencyId, int amount, string reason ) : void
subtractItemFromInventoryNative ( int itemId, int amount, string reason ) : void
trackEventNative ( string eventName ) : void
trackEventWithParamsNative ( string eventName, string jsonStringParams ) : void
updatePlayerDataNative ( ) : void

Method Details

AddCurrencyToWallet() public method

public AddCurrencyToWallet ( int currencyId, int amount, string reason ) : void
currencyId int
amount int
reason string
return void

AddItemToInventory() public method

public AddItemToInventory ( int itemId, int amount, string reason ) : void
itemId int
amount int
reason string
return void

BuyBundle() public method

public BuyBundle ( int bundleId, string reason ) : void
bundleId int
reason string
return void

ClosedParentalGate() public method

Call to inform the SDK that the parental gate was (not) passes
public ClosedParentalGate ( bool pass ) : void
pass bool
return void

ConsumeBundle() public method

public ConsumeBundle ( int bundleId, string reason ) : void
bundleId int
reason string
return void

DisableAutomaticRegisterForPushNotifications() public method

Disables the automatic register for push notifications. Should be called before SpilInit!
public DisableAutomaticRegisterForPushNotifications ( ) : void
return void

GetAllPackages() protected method

protected GetAllPackages ( ) : string
return string

GetConfigAll() public method

Returns the game config as a json string. This is not essential for developers so could be made private (getConfig() uses it so it cannot be removed entirely) but might be handy for some developers so we left it in.
public GetConfigAll ( ) : string
return string

GetConfigValue() public method

Method that returns a configuration value from the game config based on key
public GetConfigValue ( string key ) : string
key string
return string

GetInvetoryFromSdk() public method

public GetInvetoryFromSdk ( ) : string
return string

GetOtherUsersGameState() public method

Gets the public game state of other users.
public GetOtherUsersGameState ( string provider, string userIdsJsonArray ) : void
provider string Provider.
userIdsJsonArray string User identifiers json array.
return void

GetPackage() protected method

protected GetPackage ( string key ) : string
key string
return string

GetPrivateGameState() public method

Gets the state of the private game.
public GetPrivateGameState ( ) : string
return string

GetPublicGameState() public method

Gets the public game state.
public GetPublicGameState ( ) : string
return string

GetSpilGameDataFromSdk() public method

public GetSpilGameDataFromSdk ( ) : string
return string

GetSpilUserId() public method

Retrieves the Spil User Id so that developers can show this in-game for users. If users contact Spil customer service they can supply this Id so that customer support can help them properly. Please make this Id available for users in one of your game's screens.
public GetSpilUserId ( ) : string
return string

GetUserId() public method

Retrieves the custom User Id
public GetUserId ( ) : string
return string

GetUserProvider() public method

Gets the user provider.
public GetUserProvider ( ) : string
return string

GetWalletFromSdk() public method

public GetWalletFromSdk ( ) : string
return string

PlayMoreApps() public method

This can be called to show the "more apps" activity, for instance after calling "RequestMoreApps()" and receiving an "AdAvailable" event the developer could call this method from the event handler. When calling this method "RequestMoreApps()" must first have been called to request and cache a video. If no video is available then nothing will happen.
public PlayMoreApps ( ) : void
return void

PlayVideo() public method

This can be called to show a video, for instance after calling "SendrequestRewardVideoEvent()" and receiving an "AdAvailable" event the developer could call this method from the event handler. When calling this method "SendrequestRewardVideoEvent()" must first have been called to request and cache a video. If no video is available then nothing will happen.
public PlayVideo ( ) : void
return void

RegisterForPushNotifications() public method

Registers for push notifications for iOS. Can be used then the automatic registration was disabled using: DisableAutomaticRegisterForPushNotifications();
public RegisterForPushNotifications ( ) : void
return void

RequestDailyBonus() public method

public RequestDailyBonus ( ) : void
return void

RequestMoreApps() public method

Sends the "requestAd" event with the "moreApps" parameter to the native Spil SDK which will send a request to the back-end. When a response has been received from the back-end the SDK will fire either an "AdAvailable" or and "AdNotAvailable" event to which the developer can subscribe and for instance call PlayVideo(); or PlayMoreApps();
public RequestMoreApps ( ) : void
return void

RequestSplashScreen() public method

public RequestSplashScreen ( ) : void
return void

SendCustomEvent() public method

Sends an event to the native Spil SDK which will send a request to the back-end. Custom events may be tracked as follows: To track an simple custom event, simply call Spil.Instance.SendCustomEvent(String eventName); from anywhere in your code. To pass more information with the event create a <String, String> Dictionary and pass that as the second parameter like so: Dictionary<String, String> eventParams = new Dictionary<String,String>(); eventParams.Add(“level”,levelName); Spil.Instance.SendCustomEvent(“PlayerDeath”, eventParams); See https://github.com/spilgames/spil_event_unity_plugin for more information on events. This method was previously called "TrackEvent".
public SendCustomEvent ( string eventName, object>.Dictionary dict ) : void
eventName string
dict object>.Dictionary
return void

SendCustomEvent() public method

Sends an event to the native Spil SDK which will send a request to the back-end. Custom events may be tracked as follows: To track an simple custom event, simply call Spil.Instance.SendCustomEvent(String eventName); from anywhere in your code. To pass more information with the event create a <String, String> Dictionary and pass that as the second parameter like so: Dictionary<String, String> eventParams = new Dictionary<String,String>(); eventParams.Add(“level”,levelName); Spil.Instance.SendCustomEvent(“PlayerDeath”, eventParams); See https://github.com/spilgames/spil_event_unity_plugin for more information on events. This method was previously called "TrackEvent".
public SendCustomEvent ( string eventName, string>.Dictionary dict ) : void
eventName string
dict string>.Dictionary
return void

SetCustomBundleId() public method

public SetCustomBundleId ( string bundleId ) : void
bundleId string
return void

SetPluginInformation() public method

public SetPluginInformation ( string PluginName, string PluginVersion ) : void
PluginName string
PluginVersion string
return void

SetPrivateGameState() public method

Sets the state of the private game.
public SetPrivateGameState ( string privateData ) : void
privateData string Private data.
return void

SetPublicGameState() public method

Sets the public game state.
public SetPublicGameState ( string publicData ) : void
publicData string Public data.
return void

SetShowToastOnVideoReward() public method

When Fyber has shown a reward video and the user goes back to the game to receive his/her reward Fyber can automatically show a toast message with information about the reward, for instance "You've received 50 coins". This is disabled by default to allow the developer to create a reward notification for the user. Developers can call SetShowToastOnVideoReward(true) to enable Fyber's automatic toast message.
public SetShowToastOnVideoReward ( bool value ) : void
value bool
return void

SetUserId() public method

Sets the custom User Id for a provider
public SetUserId ( string providerId, string userId ) : void
providerId string
userId string
return void

ShowContactCenter() public method

public ShowContactCenter ( ) : void
return void

ShowHelpCenter() public method

public ShowHelpCenter ( ) : void
return void

ShowHelpCenterWebview() public method

public ShowHelpCenterWebview ( ) : void
return void

SubtractCurrencyFromWallet() public method

public SubtractCurrencyFromWallet ( int currencyId, int amount, string reason ) : void
currencyId int
amount int
reason string
return void

SubtractItemFromInventory() public method

public SubtractItemFromInventory ( int itemId, int amount, string reason ) : void
itemId int
amount int
reason string
return void

TestRequestAd() public method

Method that initiaties a Test Ad. This is not essential for developers so could be hidden but it might be handy for some developers so we left it in.
public TestRequestAd ( string providerName, string adType, bool parentalGate ) : void
providerName string
adType string
parentalGate bool
return void

UpdatePackagesAndPromotions() public method

Method that requests packages and promotions from the server. This is called automatically by the Spil SDK when the game starts. This is not essential so could be removed but might be handy for some developers so we left it in.
public UpdatePackagesAndPromotions ( ) : void
return void

UpdatePlayerData() public method

public UpdatePlayerData ( ) : void
return void

Property Details

disableAutomaticRegisterForPushNotifications protected_oe property

protected bool disableAutomaticRegisterForPushNotifications
return bool