// Performs a request for any available Twitter API methods.  methodType must be either "get" or "post".  path is the
    // url fragment from the API docs (excluding https://api.twitter.com) and parameters is a dictionary of key/value pairs
    // for the given method.  See Twitter's API docs for all available methods
    public static void performRequest( string methodType, string path, Dictionary<string,string> parameters )
    {
        if( Application.platform != RuntimePlatform.Android )
            return;

        string param = parameters != null ? parameters.toJson() : string.Empty;
        _plugin.Call( "performRequest", methodType, path, param );
    }
Example #2
0
	// Sets user cookies for the ad session
	public static void adsSetUserCookies( Dictionary<string,string> cookies )
	{
		if( Application.platform == RuntimePlatform.IPhonePlayer )
			_flurryAdsSetUserCookies( cookies.toJson() );
	}
	// Shows the Facebook share dialog. Valid dictionary keys (from FBShareDialogParams) are: link, name, caption, description, picture, friends (array)
	public static void showFacebookShareDialog( Dictionary<string,object> parameters )
	{
		if( Application.platform == RuntimePlatform.IPhonePlayer )
			_facebookShowFacebookShareDialog( parameters.toJson() );
	}
	// Allows you to use any available Facebook Graph API method
    public static void graphRequest( string graphPath, string httpMethod, Dictionary<string,object> keyValueHash )
    {
        if( Application.platform == RuntimePlatform.IPhonePlayer )
		{
			// convert the Dictionary to JSON
			string jsonDict = keyValueHash.toJson();
			if( jsonDict != null )
			{
				// if we arent logged in start up the babysitter
				if( !isSessionValid() )
				{
					babysitRequest( true, () => { _facebookGraphRequest( graphPath, httpMethod, jsonDict ); } );
				}
				else
				{
					_facebookGraphRequest( graphPath, httpMethod, jsonDict );
				}
			}
 		}
	}
	// Full access to any existing or new Facebook dialogs that get added.  See Facebooks documentation for parameters and dialog types
    public static void showDialog( string dialogType, Dictionary<string,string> options )
    {
        if( Application.platform == RuntimePlatform.IPhonePlayer )
		{
			// if we arent logged in start up the babysitter
			if( !isSessionValid() )
			{
				babysitRequest( false, () => { _facebookShowDialog( dialogType, options.toJson() ); } );
			}
			else
			{
				_facebookShowDialog( dialogType, options.toJson() );
			}
		}
    }
Example #6
0
	// Performs a request for any available Twitter API methods.  methodType must be either "get" or "post".  path is the
	// url fragment from the API docs (excluding https://api.twitter.com) and parameters is a dictionary of key/value pairs
	// for the given method.  Path must request .json!  See Twitter's API docs for all available methods.
	public static void performRequest( string methodType, string path, Dictionary<string,string> parameters )
	{
		if( Application.platform == RuntimePlatform.IPhonePlayer )
			_twitterPerformRequest( methodType, path, parameters != null ? parameters.toJson() : null );
	}
 // Tracks an event with a value and additional metadata
 public static void trackEventWithValueAndMetadata( string eventIdentifier, float value, Dictionary<string,string> metadata )
 {
     if( Application.platform == RuntimePlatform.IPhonePlayer )
         _chartBoostTrackEventWithValueAndMetadata( eventIdentifier, value, metadata.toJson() );
 }
Example #8
0
	// Full access to any existing or new Facebook dialogs that get added.  See Facebooks documentation for parameters and dialog types
	public static void showDialog( string dialogType, Dictionary<string,string> parameters )
	{
		if( Application.platform != RuntimePlatform.Android )
			return;

		parameters = parameters ?? new Dictionary<string,string>();

		if( !isSessionValid() )
			babysitRequest( false, () => { _facebookPlugin.Call( "showDialog", dialogType, parameters.toJson() ); } );
		else
			_facebookPlugin.Call( "showDialog", dialogType, parameters.toJson() );
	}
 // Reports an achievement notification the given title and content
 public static void SendEventWithParam( string eventId, Dictionary<string,string> param)
 {
     // Call plugin only when running on real device
     if( Application.platform == RuntimePlatform.IPhonePlayer )
         _sendEventWithParam( eventId , param.toJson());
 }
Example #10
0
	// Starts up the SDK with the given appId and userData. See VGUserData for allowed values.
	public static void startWithAppIdAndUserData( string appId, Dictionary<string,object> userData )
	{
		if( Application.platform == RuntimePlatform.IPhonePlayer )
			_vungleStartWithAppIdAndUserData( appId, userData.toJson() );
	}
Example #11
0
    /// <summary>
    /// Add the specified val and metadata.
    /// </summary>
    /// <param name='val'>
    /// Value.
    /// </param>
    /// <param name='metadata'>
    /// Metadata.
    /// </param>
    public void Add(String val, Dictionary<String, String> metadata){
#if UNITY_ANDROID
        javaObject.Call ("add", val, DictionaryToAndroidHashMap(metadata)); 
#elif UNITY_IOS
        string metadataAsJSON = null != metadata ? metadata.toJson() : null;
        if(null != addStringWithMetadataToList) {
            addStringWithMetadataToList(key,val,metadataAsJSON);
        }
#endif
    }
Example #12
0
 /// <summary>
 /// Set the specified val and metadata.
 /// </summary>
 /// <param name='val'>
 /// Value.
 /// </param>
 /// <param name='metadata'>
 /// Metadata.
 /// </param>
 public void Set(string val, Dictionary<string, string> metadata)
 {
     #if UNITY_ANDROID
         javaObject.Call ("set", val, DictionaryToAndroidHashMap(metadata));
     #elif UNITY_IOS && !UNITY_EDITOR
     string metadataAsJSON = (null != metadata) ? metadata.toJson() : null;
     _AmazonGCWSSetLatestStringMetadataAsJSON(key, val, metadataAsJSON);
     #endif
 }
Example #13
0
      /// <summary>
      /// Set the specified val and metadata.
      /// </summary>
      /// <param name='val'>
      /// Value.
      /// </param>
      /// <param name='metadata'>
      /// Metadata.
      /// </param>
    public void Set(string val, Dictionary<string,string> metadata){
#if UNITY_ANDROID
        javaObject.Call ("set", val, DictionaryToAndroidHashMap(metadata));    
#elif UNITY_IOS
        string metadataAsJSON = null != metadata ? metadata.toJson() : null;
        if(null != setNumberWithStringAndMetadata) {
            setNumberWithStringAndMetadata(key, val, metadataAsJSON);
        }       
#endif
    }
Example #14
0
	// Calls a custom Graph API method with the key/value pairs in the Dictionary.  Pass in a null dictionary if no parameters are needed.
	public static void graphRequest( string graphPath, string httpMethod, Dictionary<string,string> parameters )
	{
		if( Application.platform != RuntimePlatform.Android )
			return;

		parameters = parameters ?? new Dictionary<string,string>();

		// call off to java land
		if( !isSessionValid() )
			babysitRequest( true, () => { _facebookPlugin.Call( "graphRequest", graphPath, httpMethod, parameters.toJson() ); } );
		else
			_facebookPlugin.Call( "graphRequest", graphPath, httpMethod, parameters.toJson() );
	}
Example #15
0
 // Full access to any existing or new Facebook dialogs that get added.  See Facebooks documentation for parameters and dialog types
 public static void showDialog( string dialogType, Dictionary<string,string> options )
 {
     if( Application.platform == RuntimePlatform.IPhonePlayer )
         _facebookShowDialog( dialogType, options.toJson() );
 }
    // Tracks an event with optional meta data
    public static void trackEvent( string eventIdentifier, double value, Dictionary<string,object> metaData )
    {
        if( Application.platform != RuntimePlatform.Android )
            return;

        metaData = metaData ?? new Dictionary<string,object>();
        _plugin.Call( "trackEvent", eventIdentifier, value, metaData.toJson() );
    }
Example #17
0
	public static void logEvent( string eventName, Dictionary<string,string> parameters, bool isTimed )
	{
		if( Application.platform != RuntimePlatform.Android )
			return;

		if( parameters == null )
		{
			Debug.LogError( "attempting to call logEvent with null parameters" );
			return;
		}

		if( isTimed )
			_plugin.Call( "logTimedEventWithParams", eventName, parameters.toJson() );
		else
			_plugin.Call( "logEventWithParams", eventName, parameters.toJson() );
	}
Example #18
0
	// Shows the native Facebook Share Dialog. Valid dictionary keys (from FBShareDialogParams) are: link, name, caption, description, picture, friends (array)
	public static void showFacebookShareDialog( Dictionary<string,object> parameters )
	{
		if( Application.platform != RuntimePlatform.Android )
			return;

		_facebookPlugin.Call( "showFacebookShareDialog", parameters.toJson() );
	}