Subversion Repositories SmartDukaan

Rev

Rev 21169 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21169 Rev 21213
Line 54... Line 54...
54
import java.util.ArrayList;
54
import java.util.ArrayList;
55
 
55
 
56
 
56
 
57
public class SplashScreen extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{
57
public class SplashScreen extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{
58
    SharedPreferences apiData, userData, apkData;
58
    SharedPreferences apiData, userData, apkData;
59
    SharedPreferences.Editor apiEditor, userEditor, apkDataEditor;
59
    SharedPreferences.Editor apiEditor, userEditor, apkDataEditor,userDataEditor;
60
    UtilityFunctions utilityFunctions;
60
    UtilityFunctions utilityFunctions;
61
    AlertDialog dialog1;
61
    AlertDialog dialog1;
62
    AlertDialog.Builder b;
62
    AlertDialog.Builder b;
63
    ProgressBar pd;
63
    ProgressBar pd;
64
    FirebaseInstanceId fcm;
64
    FirebaseInstanceId fcm;
Line 451... Line 451...
451
                return msg;
451
                return msg;
452
            }
452
            }
453
 
453
 
454
            @Override
454
            @Override
455
            protected void onPostExecute(String msg) {
455
            protected void onPostExecute(String msg) {
-
 
456
                if(userData.getString("fcm_token_sent","false").equalsIgnoreCase("false")) {
456
                new gcmPushData().execute(msg);
457
                    new gcmPushData().execute(msg);
-
 
458
                }
457
            }
459
            }
458
        }.execute(null, null, null);
460
        }.execute(null, null, null);
459
    }
461
    }
460
 
462
 
461
 
463
 
Line 484... Line 486...
484
                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairsGcm));
486
                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairsGcm));
485
                HttpResponse response = httpclient.execute(httppost);
487
                HttpResponse response = httpclient.execute(httppost);
486
                HttpEntity entity = response.getEntity();
488
                HttpEntity entity = response.getEntity();
487
                int status = response.getStatusLine().getStatusCode();
489
                int status = response.getStatusLine().getStatusCode();
488
 
490
 
489
                if (status == 200) {
491
                if(status == 200){
490
                    Log.d("ResponseCode GCM ", status + "");
492
                    Log.d("ResponseCode GCM ",status+"");
-
 
493
                    userDataEditor.putString("fcm_token_sent", "true");
-
 
494
                    userDataEditor.commit();
491
                } else {
495
                } else {
492
                    Log.d("ResponseCode GCM ", status + "");
496
                    Log.d("ResponseCode GCM ",status+"");
493
                }
497
                }
494
 
498
 
495
                nameValuePairsGcm.clear();
499
                nameValuePairsGcm.clear();
496
                Log.e("pass 1", "connection success ");
500
                Log.e("pass 1", "connection success ");
497
            } catch (Exception e) {
501
            } catch (Exception e) {
Line 499... Line 503...
499
 
503
 
500
            }
504
            }
501
            return id;
505
            return id;
502
        }
506
        }
503
 
507
 
-
 
508
 
504
        @Override
509
        @Override
505
        protected void onPostExecute(String result) {
510
        protected void onPostExecute(String result) {
506
            super.onPostExecute(result);
511
            super.onPostExecute(result);
507
            final String idCheck = userData.getString("id",null);
512
            final String idCheck = userData.getString("id",null);
508
            if(userData.getString("docsSubmitted","false").equalsIgnoreCase("true")){
513
            if(userData.getString("docsSubmitted","false").equalsIgnoreCase("true")){