コード例 #1
0
    /// <summary>
    /// This method is called to initialize the TapjoyConnect system. This method should be called upon app initialization and must not have logic to prevent it from being called in any case.
    /// </summary>
    /// <param name="appID">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="secretKey">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="flags">
    /// A <see cref="System.Collections.Hashtable" />
    /// </param>
    public static void RequestTapjoyConnect(string appID, string secretKey, Dictionary <string, System.Object> flags)
    {
        if (flags != null)
        {
            // Convert C# connectFlags dictionary to Java dictionary
            foreach (KeyValuePair <string, System.Object> kvp in flags)
            {
                // Is the value is a dictionary itself
                if (kvp.Value.GetType().IsGenericType)
                {
                    Dictionary <string, System.Object> dictionaryToTransfer = (Dictionary <string, System.Object>)kvp.Value;

                    String dictionaryName = kvp.Key;
                    // Communicate with java to build the dictionary
                    transferDictionaryToJavaWithName(dictionaryToTransfer, dictionaryName);
                    // Tell java to add the dictionary *dictionaryName* to dictionary "connectFlags" under the key *kvp.key*
                    TapjoyConnect.CallStatic("setDictionaryInDictionary", kvp.Key, dictionaryName, TapjoyPluginAndroid.CONNECT_FLAG_DICTIONARY_NAME);
                }
                else
                {
                    // Tell java to add the value *kvp.Value* to dictionary "connectFlags" under the key *kvp.Key*
                    TapjoyConnect.CallStatic("setKeyValueInDictionary", kvp.Key, kvp.Value, TapjoyPluginAndroid.CONNECT_FLAG_DICTIONARY_NAME);
                }
            }
        }

        TapjoyConnect.CallStatic("requestTapjoyConnect", currentActivity, appID, secretKey);
    }
コード例 #2
0
 /// <summary>
 /// Transfers a C# Dictionary<string, System.Object> into a Java HashTable<String, Object>
 /// </summary>
 /// <param name="dictionary">
 /// A <see cref="System.Collections.Hashtable"/>
 /// </param>
 /// <param name="dictionaryName">
 /// A <see cref="System.String"/>
 /// </param>
 public static void transferDictionaryToJavaWithName(Dictionary <string, System.Object> dictionary, String dictionaryName)
 {
     foreach (KeyValuePair <string, System.Object> kvp in dictionary)
     {
         TapjoyConnect.CallStatic("setKeyValueInDictionary", kvp.Key, kvp.Value, dictionaryName);
     }
 }
コード例 #3
0
    /// <summary>
    /// This method is called to initialize the TapjoyConnect system. This method should be called upon app initialization and must not have logic to prevent it from being called in any case.
    /// </summary>
    /// <param name="appID">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="secretKey">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="flags">
    /// A <see cref="System.Collections.Hashtable" />
    /// </param>
    public static void RequestTapjoyConnect(string appID, string secretKey, Dictionary <string, string> flags)
    {
        if (flags != null)
        {
            foreach (KeyValuePair <string, string> kvp in flags)
            {
                TapjoyConnect.CallStatic("setFlagKeyValue", kvp.Key, kvp.Value);
            }
        }

        TapjoyConnect.CallStatic("requestTapjoyConnect", currentActivity, appID, secretKey);
    }
コード例 #4
0
 /// <summary>
 /// Sets the GameObject handler class name.  MUST BE CALLED BEFORE ANY TAPJOY LIBRARY METHODS.
 /// </summary>
 /// <param name="handlerName">
 /// A <see cref="System.String"/>
 /// </param>
 public static void SetCallbackHandler(string handlerName)
 {
     TapjoyConnect.CallStatic("setHandlerClass", handlerName);
 }