C# Class SpilGames.Unity.Implementations.SpiliOSUnityImplementation

Inheritance: SpilUnityImplementationBase
Afficher le fichier Open project: spilgames/spil_event_unity_plugin

Protected Properties

Свойство Type Description
disableAutomaticRegisterForPushNotifications bool

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
GetAllPackages ( ) : string
GetPackage ( string key ) : string

Private Methods

Méthode 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 méthode

public AddCurrencyToWallet ( int currencyId, int amount, string reason ) : void
currencyId int
amount int
reason string
Résultat void

AddItemToInventory() public méthode

public AddItemToInventory ( int itemId, int amount, string reason ) : void
itemId int
amount int
reason string
Résultat void

BuyBundle() public méthode

public BuyBundle ( int bundleId, string reason ) : void
bundleId int
reason string
Résultat void

ClosedParentalGate() public méthode

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

ConsumeBundle() public méthode

public ConsumeBundle ( int bundleId, string reason ) : void
bundleId int
reason string
Résultat void

DisableAutomaticRegisterForPushNotifications() public méthode

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

GetAllPackages() protected méthode

protected GetAllPackages ( ) : string
Résultat string

GetConfigAll() public méthode

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
Résultat string

GetConfigValue() public méthode

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

GetInvetoryFromSdk() public méthode

public GetInvetoryFromSdk ( ) : string
Résultat string

GetOtherUsersGameState() public méthode

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

GetPackage() protected méthode

protected GetPackage ( string key ) : string
key string
Résultat string

GetPrivateGameState() public méthode

Gets the state of the private game.
public GetPrivateGameState ( ) : string
Résultat string

GetPublicGameState() public méthode

Gets the public game state.
public GetPublicGameState ( ) : string
Résultat string

GetSpilGameDataFromSdk() public méthode

public GetSpilGameDataFromSdk ( ) : string
Résultat string

GetSpilUserId() public méthode

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
Résultat string

GetUserId() public méthode

Retrieves the custom User Id
public GetUserId ( ) : string
Résultat string

GetUserProvider() public méthode

Gets the user provider.
public GetUserProvider ( ) : string
Résultat string

GetWalletFromSdk() public méthode

public GetWalletFromSdk ( ) : string
Résultat string

PlayMoreApps() public méthode

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
Résultat void

PlayVideo() public méthode

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
Résultat void

RegisterForPushNotifications() public méthode

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

RequestDailyBonus() public méthode

public RequestDailyBonus ( ) : void
Résultat void

RequestMoreApps() public méthode

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
Résultat void

RequestSplashScreen() public méthode

public RequestSplashScreen ( ) : void
Résultat void

SendCustomEvent() public méthode

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
Résultat void

SendCustomEvent() public méthode

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
Résultat void

SetCustomBundleId() public méthode

public SetCustomBundleId ( string bundleId ) : void
bundleId string
Résultat void

SetPluginInformation() public méthode

public SetPluginInformation ( string PluginName, string PluginVersion ) : void
PluginName string
PluginVersion string
Résultat void

SetPrivateGameState() public méthode

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

SetPublicGameState() public méthode

Sets the public game state.
public SetPublicGameState ( string publicData ) : void
publicData string Public data.
Résultat void

SetShowToastOnVideoReward() public méthode

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
Résultat void

SetUserId() public méthode

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

ShowContactCenter() public méthode

public ShowContactCenter ( ) : void
Résultat void

ShowHelpCenter() public méthode

public ShowHelpCenter ( ) : void
Résultat void

ShowHelpCenterWebview() public méthode

public ShowHelpCenterWebview ( ) : void
Résultat void

SubtractCurrencyFromWallet() public méthode

public SubtractCurrencyFromWallet ( int currencyId, int amount, string reason ) : void
currencyId int
amount int
reason string
Résultat void

SubtractItemFromInventory() public méthode

public SubtractItemFromInventory ( int itemId, int amount, string reason ) : void
itemId int
amount int
reason string
Résultat void

TestRequestAd() public méthode

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
Résultat void

UpdatePackagesAndPromotions() public méthode

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
Résultat void

UpdatePlayerData() public méthode

public UpdatePlayerData ( ) : void
Résultat void

Property Details

disableAutomaticRegisterForPushNotifications protected_oe property

protected bool disableAutomaticRegisterForPushNotifications
Résultat bool