Sitelet https://github.com/SaffronCode/SaffronCode/commit/25b1aa7069e650f9d9c0af96728f9f177626fb55
Skip to content

Commit 25b1aa7

Browse files
PageLogger!!
1 parent a97c097 commit 25b1aa7

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎appManager/mains/AppWithContent.as‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import flash.display.DisplayObjectContainer;
6262
import com.mteamapp.BlackStageDebugger;
6363
import nativeClasses.distriqtApplication.DistriqtApplication;
64+
import flash.net.URLLoader;
6465

6566
public class AppWithContent extends App
6667
{
@@ -87,6 +88,8 @@
8788

8889
/**StageMask is using to cover the bottom of the page, when a keboard moves stage to up */
8990
private var stageMask:Sprite ;
91+
92+
private var pageLoggerRequest:URLRequest,pageLoggerLoader:URLLoader;
9093

9194
/**This is the contentManager rectangle size. it will generate from the content w and h on the home xml tag*/
9295
public static function get contentRect():Rectangle
@@ -459,6 +462,13 @@
459462
{
460463
SaffronLogger.log("History changed");
461464
History.pushHistory((event as AppEventContent).linkData);
465+
466+
467+
}
468+
469+
if(event2!=null)
470+
{
471+
logPageChange(event2.myID);
462472
}
463473

464474
if((!DevicePrefrence.isItPC) && mouseClickCounter>0)
@@ -469,6 +479,24 @@
469479

470480
return duplicatePageController ;
471481
}
482+
483+
/**Save teh page ID to Analytic server */
484+
private function logPageChange(pageId:String):void
485+
{
486+
if(pageLoggerRequest==null)
487+
{
488+
pageLoggerRequest = new URLRequest(Contents.config.version_controll_url);
489+
pageLoggerRequest.contentType = 'application/json';
490+
pageLoggerRequest.method = URLRequestMethod.POST ;
491+
}
492+
pageLoggerRequest.data = JSON.stringify({AppId:DevicePrefrence.appID,PageName:pageId,Enter:true}) ;
493+
if(pageLoggerLoader==null)
494+
{
495+
pageLoggerLoader = new URLLoader();
496+
}
497+
pageLoggerLoader.load(pageLoggerRequest);
498+
499+
}
472500

473501
/**Contents are load now*/
474502
protected function startApp():void

0 commit comments

Comments
 (0)