| Line 34... |
Line 34... |
| 34 |
import com.google.android.gms.plus.Plus;
|
34 |
import com.google.android.gms.plus.Plus;
|
| 35 |
import com.mixpanel.android.mpmetrics.MixpanelAPI;
|
35 |
import com.mixpanel.android.mpmetrics.MixpanelAPI;
|
| 36 |
import com.saholic.profittill.Constants.ProfitTillConstants;
|
36 |
import com.saholic.profittill.Constants.ProfitTillConstants;
|
| 37 |
import com.saholic.profittill.R;
|
37 |
import com.saholic.profittill.R;
|
| 38 |
import com.saholic.profittill.Utils.AnalyticsUtility;
|
38 |
import com.saholic.profittill.Utils.AnalyticsUtility;
|
| - |
|
39 |
import com.saholic.profittill.Utils.DESEncrypter;
|
| 39 |
import com.saholic.profittill.Utils.UtilityFunctions;
|
40 |
import com.saholic.profittill.Utils.UtilityFunctions;
|
| 40 |
import com.saholic.profittill.Volley.Analytics;
|
41 |
import com.saholic.profittill.Volley.Analytics;
|
| 41 |
import com.saholic.profittill.Volley.AnalyticsErrorResponse;
|
42 |
import com.saholic.profittill.Volley.AnalyticsErrorResponse;
|
| 42 |
import com.saholic.profittill.Volley.AnalyticsJsonResponse;
|
43 |
import com.saholic.profittill.Volley.AnalyticsJsonResponse;
|
| 43 |
import com.saholic.profittill.navigationdrawer.ExpandableNavigationAdapter;
|
44 |
import com.saholic.profittill.navigationdrawer.ExpandableNavigationAdapter;
|
| Line 193... |
Line 194... |
| 193 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp",UtilityFunctions.notificationDate()));
|
194 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp",UtilityFunctions.notificationDate()));
|
| 194 |
nameValuePairsGcm.add(new BasicNameValuePair("result","opened"));
|
195 |
nameValuePairsGcm.add(new BasicNameValuePair("result","opened"));
|
| 195 |
getIntent().getExtras().remove("cid");
|
196 |
getIntent().getExtras().remove("cid");
|
| 196 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
197 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
| 197 |
}else if(getIntent().getAction()=="31"){
|
198 |
}else if(getIntent().getAction()=="31"){
|
| 198 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
- |
|
| 199 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
- |
|
| 200 |
t.send(new HitBuilders.EventBuilder()
|
- |
|
| 201 |
.setCategory("Email Url Opener")
|
- |
|
| 202 |
.setAction("Email Url Opened ")
|
- |
|
| 203 |
.setLabel("For User Id " + userData.getString("id","0"))
|
- |
|
| 204 |
.build());
|
- |
|
| 205 |
flag=20;
|
- |
|
| 206 |
String emailURL= String.valueOf(getIntent().getData());
|
199 |
String emailURL= String.valueOf(getIntent().getData());
|
| - |
|
200 |
Uri url = Uri.parse(emailURL);
|
| - |
|
201 |
if(url.getQueryParameter("intent_type").equalsIgnoreCase("url")){
|
| - |
|
202 |
String campaignId = url.getQueryParameter("campaign");
|
| - |
|
203 |
DESEncrypter desEncrypter = new DESEncrypter(ProfitTillConstants.AUTH_PASSWORD);
|
| - |
|
204 |
String urlOpen = desEncrypter.decrypt(url.getQueryParameter("key"));
|
| - |
|
205 |
String campaignUserId=urlOpen.split("user_id=")[1];
|
| - |
|
206 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
| - |
|
207 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| - |
|
208 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
209 |
.setCategory("Message/Email")
|
| - |
|
210 |
.setAction("Message/Email Opened For User Id " + UtilityFunctions.campaignUserId(url))
|
| - |
|
211 |
.setLabel("Campaign Id " + campaignId)
|
| - |
|
212 |
.build());
|
| - |
|
213 |
|
| - |
|
214 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
| - |
|
215 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,UtilityFunctions.campaignUserId(url),"Message","Message Opened",campaignId),
|
| - |
|
216 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
| - |
|
217 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| - |
|
218 |
|
| - |
|
219 |
nameValuePairsGcm = new ArrayList<>();
|
| - |
|
220 |
nameValuePairsGcm.add(new BasicNameValuePair("user_id",campaignUserId));
|
| - |
|
221 |
nameValuePairsGcm.add(new BasicNameValuePair("cid",campaignId));
|
| - |
|
222 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp",UtilityFunctions.notificationDate()));
|
| - |
|
223 |
nameValuePairsGcm.add(new BasicNameValuePair("result","message_opened"));
|
| - |
|
224 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
| - |
|
225 |
flag=20;
|
| - |
|
226 |
notificationURL=urlOpen.replace("?user_id="+campaignUserId,"?user_id="+userData.getString("id",""));
|
| - |
|
227 |
}else if (url.getQueryParameter("intent_type").equalsIgnoreCase("native")){
|
| - |
|
228 |
String campaignId = url.getQueryParameter("campaign");
|
| - |
|
229 |
DESEncrypter desEncrypter = new DESEncrypter(ProfitTillConstants.AUTH_PASSWORD);
|
| - |
|
230 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
| - |
|
231 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| - |
|
232 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
233 |
.setCategory("Message/Email")
|
| - |
|
234 |
.setAction("Message/Email Opened For User Id " + userData.getString("id",""))
|
| - |
|
235 |
.setLabel("Campaign Id " + campaignId)
|
| - |
|
236 |
.build());
|
| - |
|
237 |
|
| - |
|
238 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
| - |
|
239 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Message","Message Opened",campaignId),
|
| - |
|
240 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
| - |
|
241 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| - |
|
242 |
|
| - |
|
243 |
nameValuePairsGcm = new ArrayList<>();
|
| - |
|
244 |
nameValuePairsGcm.add(new BasicNameValuePair("user_id",userData.getString("id","")));
|
| - |
|
245 |
nameValuePairsGcm.add(new BasicNameValuePair("cid",campaignId));
|
| - |
|
246 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp",UtilityFunctions.notificationDate()));
|
| - |
|
247 |
nameValuePairsGcm.add(new BasicNameValuePair("result","message_opened"));
|
| - |
|
248 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
| - |
|
249 |
|
| - |
|
250 |
if(desEncrypter.decrypt(url.getQueryParameter("key")).equalsIgnoreCase("profile")){
|
| - |
|
251 |
flag=15;
|
| - |
|
252 |
}
|
| - |
|
253 |
else if(desEncrypter.decrypt(url.getQueryParameter("key")).equalsIgnoreCase("contact")){
|
| - |
|
254 |
flag=6;
|
| - |
|
255 |
}
|
| - |
|
256 |
else if(desEncrypter.decrypt(url.getQueryParameter("key")).equalsIgnoreCase("tutorial")){
|
| - |
|
257 |
flag=7;
|
| - |
|
258 |
}else{
|
| - |
|
259 |
flag=20;
|
| - |
|
260 |
notificationURL = apiData.getString("mobile.website.url","http://api.profittill.com/deals")+"?user_id=" + userData.getString("id","");
|
| - |
|
261 |
}
|
| - |
|
262 |
}else if (url.getQueryParameter("intent_type").equalsIgnoreCase("update")){
|
| - |
|
263 |
String campaignId = url.getQueryParameter("campaign");
|
| - |
|
264 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
| - |
|
265 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| - |
|
266 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
267 |
.setCategory("Message/Email")
|
| - |
|
268 |
.setAction("Message/Email Opened For User Id " + userData.getString("id",""))
|
| - |
|
269 |
.setLabel("Campaign Id " + campaignId)
|
| - |
|
270 |
.build());
|
| - |
|
271 |
|
| - |
|
272 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
| - |
|
273 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Message","Message Opened",campaignId),
|
| - |
|
274 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
| - |
|
275 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| - |
|
276 |
|
| - |
|
277 |
nameValuePairsGcm = new ArrayList<>();
|
| - |
|
278 |
nameValuePairsGcm.add(new BasicNameValuePair("user_id",userData.getString("id","")));
|
| - |
|
279 |
nameValuePairsGcm.add(new BasicNameValuePair("cid",campaignId));
|
| - |
|
280 |
nameValuePairsGcm.add(new BasicNameValuePair("timestamp",UtilityFunctions.notificationDate()));
|
| - |
|
281 |
nameValuePairsGcm.add(new BasicNameValuePair("result","message_opened"));
|
| - |
|
282 |
new NotificationOpenedData().execute(nameValuePairsGcm);
|
| - |
|
283 |
|
| - |
|
284 |
Intent intent = null;
|
| - |
|
285 |
try {
|
| - |
|
286 |
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getApplicationContext().getPackageName()));
|
| - |
|
287 |
} catch (android.content.ActivityNotFoundException anfe) {
|
| - |
|
288 |
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getApplicationContext().getPackageName()));
|
| - |
|
289 |
}
|
| - |
|
290 |
startActivity(intent);
|
| - |
|
291 |
}else{
|
| - |
|
292 |
flag=20;
|
| 207 |
notificationURL =new UtilityFunctions().getEmailUrlFromMap(getApplicationContext(), emailURL,apiData.getString("mobile.website.url",""))+"?user_id="+userData.getString("id","");
|
293 |
notificationURL = apiData.getString("mobile.website.url","http://api.profittill.com/deals")+"?user_id=" + userData.getString("id","");
|
| - |
|
294 |
}
|
| 208 |
}else if(getIntent().getAction()=="11"){
|
295 |
}else if(getIntent().getAction()=="11"){
|
| 209 |
flag=11;
|
296 |
flag=11;
|
| 210 |
}else {
|
297 |
}else {
|
| 211 |
Bundle i = getIntent().getExtras();
|
298 |
Bundle i = getIntent().getExtras();
|
| 212 |
if (i != null) {
|
299 |
if (i != null) {
|