Place your API_KEY and SECRET_KEY at line # 30 (sp = new ServiceAPI ("YOUR_API_KEY","YOUR_SECRET_KEY");) to initialize it.
using UnityEngine;
using UnityEngine.SocialPlatforms;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System;
using com.shephertz.app42.paas.sdk.csharp;
using com.shephertz.app42.paas.sdk.csharp.user;
using AssemblyCSharp;
public class UserTest : MonoBehaviour
{
ServiceAPI sp = null;
UserService userService = null; // Initializing User Service.
User createUserObj = null;
public string success;
UserResponse callBack = new UserResponse ();
#if UNITY_EDITOR
public static bool Validator (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
{return true;}
#endif
void Start ()
{
#if UNITY_EDITOR
ServicePointManager.ServerCertificateValidationCallback = Validator;
#endif
sp = new ServiceAPI ("YOUR_API_KEY","YOUR_SECRET_KEY");
}
void OnGUI ()
{
if (Time.time % 2 < 1) {
success = callBack.getResult ();
}
// For Setting Up ResponseBox.
GUI.TextArea (new Rect (10, 5, 1300, 175), success);
//=========================================================================
if (GUI.Button (new Rect (50, 200, 200, 30), "Create User")) {
userService = sp.BuildUserService (); // Initializing UserService.
string userName = "App42TestUser";
string password = "password";
string email = "App42TestUser@shephertz.com";
userService.CreateUser (userName, password, email, callBack);
}
}
}