| Line 9... |
Line 9... |
| 9 |
import android.content.SharedPreferences;
|
9 |
import android.content.SharedPreferences;
|
| 10 |
import android.content.pm.PackageInfo;
|
10 |
import android.content.pm.PackageInfo;
|
| 11 |
import android.content.pm.PackageManager;
|
11 |
import android.content.pm.PackageManager;
|
| 12 |
import android.content.res.Configuration;
|
12 |
import android.content.res.Configuration;
|
| 13 |
import android.net.ConnectivityManager;
|
13 |
import android.net.ConnectivityManager;
|
| - |
|
14 |
import android.net.Uri;
|
| 14 |
import android.os.AsyncTask;
|
15 |
import android.os.AsyncTask;
|
| 15 |
import android.os.Bundle;
|
16 |
import android.os.Bundle;
|
| 16 |
import android.support.v7.app.ActionBarActivity;
|
17 |
import android.support.v7.app.ActionBarActivity;
|
| 17 |
import android.telephony.TelephonyManager;
|
18 |
import android.telephony.TelephonyManager;
|
| 18 |
import android.text.TextUtils;
|
19 |
import android.text.TextUtils;
|
| Line 140... |
Line 141... |
| 140 |
nameValuePairsGcm.add(new BasicNameValuePair("cid",getIntent().getExtras().getString("cid")));
|
141 |
nameValuePairsGcm.add(new BasicNameValuePair("cid",getIntent().getExtras().getString("cid")));
|
| 141 |
nameValuePairsGcm.add(new BasicNameValuePair("result","login"));
|
142 |
nameValuePairsGcm.add(new BasicNameValuePair("result","login"));
|
| 142 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp",UtilityFunctions.notificationDate()));
|
143 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp",UtilityFunctions.notificationDate()));
|
| 143 |
getIntent().getExtras().remove("cid");
|
144 |
getIntent().getExtras().remove("cid");
|
| 144 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
145 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
| - |
|
146 |
}else if(getIntent().getAction()=="31"){
|
| - |
|
147 |
String emailURL = String.valueOf(getIntent().getData());
|
| - |
|
148 |
Uri url = Uri.parse(emailURL);
|
| - |
|
149 |
String campaignId = url.getQueryParameter("campaign");
|
| - |
|
150 |
if(url.getQueryParameter("intent_type").equalsIgnoreCase("url")) {
|
| - |
|
151 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
| - |
|
152 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| - |
|
153 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
154 |
.setCategory("Message/Email")
|
| - |
|
155 |
.setAction("Message/Email Opened For User Id " + UtilityFunctions.campaignUserId(url))
|
| - |
|
156 |
.setLabel("Campaign Id " + campaignId)
|
| - |
|
157 |
.build());
|
| - |
|
158 |
nameValuePairsGcm = new ArrayList<>();
|
| - |
|
159 |
nameValuePairsGcm.add(new BasicNameValuePair("user_id", UtilityFunctions.campaignUserId(url)));
|
| - |
|
160 |
nameValuePairsGcm.add(new BasicNameValuePair("cid", campaignId));
|
| - |
|
161 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp", UtilityFunctions.notificationDate()));
|
| - |
|
162 |
nameValuePairsGcm.add(new BasicNameValuePair("result", "message_opened_login"));
|
| - |
|
163 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
| - |
|
164 |
}else{
|
| - |
|
165 |
nameValuePairsGcm = new ArrayList<>();
|
| - |
|
166 |
nameValuePairsGcm.add(new BasicNameValuePair("user_id", userData.getString("id","")));
|
| - |
|
167 |
nameValuePairsGcm.add(new BasicNameValuePair("cid", campaignId));
|
| - |
|
168 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp", UtilityFunctions.notificationDate()));
|
| - |
|
169 |
nameValuePairsGcm.add(new BasicNameValuePair("result", "message_opened_login"));
|
| - |
|
170 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
| - |
|
171 |
}
|
| 145 |
}
|
172 |
}
|
| 146 |
/*referralCode = (EditText)findViewById(R.id.referralCode1);*/
|
- |
|
| 147 |
/* inviteError=(TextView)findViewById(R.id.inviteErrorLogin);
|
- |
|
| 148 |
inviteNumber=(TextView)findViewById(R.id.inviteNumberLogin);
|
- |
|
| 149 |
inviteMessage=(TextView)findViewById(R.id.inviteMessageLogin);
|
- |
|
| 150 |
inviteMessage1=(TextView)findViewById(R.id.inviteMessage1Login);*/
|
- |
|
| 151 |
/*
|
- |
|
| 152 |
invitationCode=apiData.getString("profitmandi.invitation.code","");
|
- |
|
| 153 |
*/
|
- |
|
| 154 |
/*
|
- |
|
| 155 |
Log.d("Invite Code Boolean","Boolean" +inviteData.getBoolean("inviteCodeRequired",true));
|
- |
|
| 156 |
if(!(inviteData.getBoolean("inviteCodeRequired",true))) {
|
- |
|
| 157 |
referralCode.setVisibility(View.GONE);
|
- |
|
| 158 |
}else{
|
- |
|
| 159 |
inviteMessage1.setVisibility(View.VISIBLE);
|
- |
|
| 160 |
inviteMessage.setVisibility(View.VISIBLE);
|
- |
|
| 161 |
inviteNumber.setVisibility(View.VISIBLE);
|
- |
|
| 162 |
inviteMessage.setText(apiData.getString("referralinvite.text","Invite Code Required."));
|
- |
|
| 163 |
inviteMessage1.setText(apiData.getString("referralinvite.call","Call to get one"));
|
- |
|
| 164 |
inviteNumber.setText(apiData.getString("contactus.number", ""));
|
- |
|
| 165 |
inviteNumber.setOnClickListener(new View.OnClickListener() {
|
- |
|
| 166 |
@Override
|
- |
|
| 167 |
public void onClick(View v) {
|
- |
|
| 168 |
Intent callIntent = new Intent(Intent.ACTION_CALL);
|
- |
|
| 169 |
callIntent.setData(Uri.parse("tel:0" + apiData.getString("contactus.number", "")));
|
- |
|
| 170 |
startActivity(callIntent);
|
- |
|
| 171 |
}
|
- |
|
| 172 |
});
|
- |
|
| 173 |
}
|
- |
|
| 174 |
StringTokenizer st = new StringTokenizer(invitationCode,"|");
|
- |
|
| 175 |
while(st.hasMoreTokens()){
|
- |
|
| 176 |
invitationCodeList.add( st.nextToken());
|
- |
|
| 177 |
}
|
- |
|
| 178 |
*/
|
- |
|
| 179 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
173 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
| 180 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
174 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| 181 |
t.setScreenName("Login Screen");
|
175 |
t.setScreenName("Login Screen");
|
| 182 |
t.send(new HitBuilders.ScreenViewBuilder().build());
|
176 |
t.send(new HitBuilders.ScreenViewBuilder().build());
|
| 183 |
|
177 |
|
| Line 185... |
Line 179... |
| 185 |
JSONObject props = new JSONObject();
|
179 |
JSONObject props = new JSONObject();
|
| 186 |
try {
|
180 |
try {
|
| 187 |
props.put("Screen", "Login Screen");
|
181 |
props.put("Screen", "Login Screen");
|
| 188 |
mixpanel.track("Login Page", props);
|
182 |
mixpanel.track("Login Page", props);
|
| 189 |
} catch (JSONException e) {
|
183 |
} catch (JSONException e) {
|
| 190 |
/* TestinAgent.uploadException(this,"Exception in Resolve sign in error", e.printStackTrace());*/
|
- |
|
| 191 |
e.printStackTrace();
|
184 |
e.printStackTrace();
|
| 192 |
}
|
185 |
}
|
| 193 |
if (Session.getActiveSession() != null) {
|
186 |
if (Session.getActiveSession() != null) {
|
| 194 |
Session.getActiveSession().closeAndClearTokenInformation();
|
187 |
Session.getActiveSession().closeAndClearTokenInformation();
|
| 195 |
}
|
188 |
}
|