public int getNotificationCount(Boolean isAsync)
 {
     // Wait for queue since we need synchronous call here.
     HelpshiftWorker.getInstance().synchronousWaitForApiCallQueue();
     hsInternalLogger.d("Call getNotificationCount: isAsync : " + isAsync);
     return(this.hsHelpshiftClass.CallStatic <int>("getNotificationCount", isAsync));
 }
 private static void initLogger()
 {
     if (HelpshiftAndroidLog.logger == null)
     {
         HelpshiftWorker.getInstance().registerClient("helpshiftandroidlog", helpshiftAndroidLog);
         HelpshiftDexLoader.getInstance().registerListener(helpshiftAndroidLog);
     }
 }
Beispiel #3
0
        public HelpshiftCampaignsAndroid()
        {
            AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");

            this.currentActivity = jc.GetStatic <AndroidJavaObject>("currentActivity");
            HelpshiftDexLoader.getInstance().registerListener(this);
            HelpshiftWorker.getInstance().registerClient("campaigns", this);
        }
Beispiel #4
0
        private HelpshiftInternalLogger()
        {
            // Register for async worker.
            HelpshiftWorker.getInstance().registerClient("HelpshiftInternalLogger", this);

            // Register for dex load listener.
            HelpshiftDexLoader.getInstance().registerListener(this);
        }
Beispiel #5
0
        public static HelpshiftWorker getInstance()
        {
            if (hsWorker == null)
            {
                hsWorker = new HelpshiftWorker();
            }

            return(hsWorker);
        }
 public HelpshiftAndroid()
 {
     this.jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
     this.currentActivity    = jc.GetStatic <AndroidJavaObject>("currentActivity");
     this.application        = currentActivity.Call <AndroidJavaObject>("getApplication");
     this.hsUnityAPIDelegate = new AndroidJavaClass("com.helpshift.supportCampaigns.UnityAPIDelegate");
     HelpshiftWorker.getInstance().registerClient("support", this);
     HelpshiftDexLoader.getInstance().loadDex(this, application);
     hsInternalLogger = HelpshiftInternalLogger.getInstance();
 }
Beispiel #7
0
 public void loadDex(IDexLoaderListener listener, AndroidJavaObject application)
 {
     this.application      = application;
     helpshiftLoaderClass  = new AndroidJavaClass("com.helpshift.dex.HelpshiftDexLoader");
     unityApiDelegateClass = new AndroidJavaClass("com.helpshift.supportCampaigns.UnityAPIDelegate");
     registerListener(listener);
     HelpshiftWorker.getInstance().registerClient("dexLoader", this);
     HelpshiftWorker.getInstance().enqueueApiCall("dexLoader", "loadHelpshiftDex", null, new object[] { helpshiftLoaderClass });
     return;
 }
        public void onDexLoaded()
        {
            // In cases where dex is already loaded, we would need to make sure that the listener
            // for worker thread is also registered since we add  "getInboxInstance" to worker queue.
            HelpshiftWorker.getInstance().registerClient("inbox", this);

            // Get the Inbox instance only after the queue finishes since we want the "install" call
            // to finish before calling Inbox.
            addHSApiCallToQueue("initializeInboxInstance", "getInboxInstance", null);
        }
 void addHSApiCallToQueue(String methodIdentifier, String api, object[] args)
 {
     HelpshiftWorker.getInstance().enqueueApiCall("support", methodIdentifier, api, args);
 }
 public static int e(String tag, String log)
 {
     initLogger();
     HelpshiftWorker.getInstance().synchronousWaitForApiCallQueue();
     return(HelpshiftAndroidLog.logger.CallStatic <int>("e", new object[] { tag, log }));
 }
 public void onApplicationQuit()
 {
     hsInternalLogger.d("onApplicationQuit");
     HelpshiftWorker.getInstance().onApplicationQuit();
 }
 public bool isConversationActive()
 {
     // Wait for queue since we need synchronous call here.
     HelpshiftWorker.getInstance().synchronousWaitForApiCallQueue();
     return(this.hsSupportClass.CallStatic <bool>("isConversationActive"));
 }
Beispiel #13
0
 private void addApiCallToQueue(string apiName, object[] args)
 {
     // Add all logger apis to the worker queue.
     HelpshiftWorker.getInstance().enqueueApiCall("HelpshiftInternalLogger", "hsLoggerWithArgs", apiName, args);
 }
 private void synchronousWaitForHSApiCallQueue()
 {
     HelpshiftWorker.getInstance().synchronousWaitForApiCallQueue();
 }
 public HelpshiftInboxAndroid()
 {
     HelpshiftDexLoader.getInstance().registerListener(this);
     HelpshiftWorker.getInstance().registerClient("inbox", this);
 }