Push notifications in Delphi XE6 are displayed - delphi

I played with TPushEvents on Android for a while and noticed: when app is minimized push notification immediately goes right to the notification area. I suppose that this behaviour is defined in the native code (inside com.embarcadero.gcm.notifications.GCMNotification).
Can anyone confirm or refute my guess?
How this behaviour can be turned off? (I need to decide by myself whether notification should be displayed to a user.)

An alternative way is to inherit FMXNativeActivity class and overrid its public void receiveGCM(Bundle bundle) method but not deal with pause condition.

I myself can confirm this guess.
Decompile classes.dex, rewrite com.embarcadero.gcm.notifications.GCMNotification to suite your needs, compile and put it back inside classes.dex using the script from here.
I'm just not sure it's legal.

Related

Codeceptjs swipe function

Im just working with codeceptjs and using appium driver for testing android application.
Now i have different issues with this framework. Im currently working for a test, where i have to use swipeLeft, but it isnt working, there is nothing happen when that function is calling, also swipe, swipeRight, swipeUp, swipeDown. Has anyone already solved this problem or can i use alternatively a back() function or something?
Use the following syntax to make your code work:
I.executeScript('mobile: swipe', {direction: 'left'});
Have you consider Touch Perform (or Action) ? It is working for me
I have used webdriverio and it seems like Codeceptjs have similarities with their implementations of appium methods for mobile automation.
Are you testing using Android or iOS device?
Have you tried using different method overrides for Swipes?
On my experience, iOS and Android have different Speed and Offset settings you need to adjust the values until you get the swipe action working.
And of course you need to make sure you are selecting the appropriate View/Slider/Element that is scrollable, otherwise swipe will fail.
https://codecept.io/helpers/Appium

How to attach Cycrypt or gdb before a program start

I am in the middle of PT where application is checking for JailBreak, sooner it starts and the first screen user see is Alert that application is Jailbroken and click okay to exit.
My question: Is there a way to attach Cycript before application starts or start application with Cycript as it seems very late to change method when it is already called by application and I am on the close alert.
Please advise.
or advise If I can run application with GDB, rather than attaching with the process later -- same issue here, it is too late to attach to gdp after running the application because decision of JailBroken is already done.
I found this link which explains in detail about run time modifications using gdb as well as with cycript.
May be helpful for you or someone else.
I just encountered same question and I got over that by using choose() in cycript and function -[UIModalView dismissWithClickedButtonIndex:animated:]
Use choose(UIAlertView) to search all AlertView
Try figure out which one is your target and call [choose(UIAlertView)[i] dismissWithClickedButtonIndex:0 animated:0]
*i is the sequence you get in step 1

onClick Action in Tabbar is not calling in Titanium

Team,
I am working on a project which is on Titanium, I am facing one small issues which i cannot find the solution, The issue is
In Index.xml file i am writing code for Tabbar, Writing the click action the tag but in iOS that method is not calling, Where as in Android it is working fine, Dont know whats wrong, Below is the code i wrote.
<Tab id="tab4" title="Coverage" icon="/images/Coverage_tab_n.png" onClick="displayCoverage" class="bcPurple_iOS">
<Window id="win4" title="Coverage" top="20" bottom="20" class="bcPurple_iOS">
</Window>
</Tab>
The onClick action code i am writing in the index.js file which is deault,Am i doing any wrong.
This is a feature request in Titanium TIMOB-6499 It was requested to be added in Android and was but hasn't been added in iOS yet.
Work around could be to use onFocus which works but might not be exactly what you want as it runs when the tabgroup opens. To avoid that, you could set a variable to stop it running on the first load I suppose.
If you're into compiling from source, there is a quick fix from someone in comment thread in the link above which may or may not work.
The feature request has been open since Dec 2011 and is marked as low priority.

monodroid activity - wrong activity at start up

I have developed a monodroid application with several activities.
Occasionally, the wrong activity is shown first, as opposed to the one with "MainLauncher=true" set.
Also, occasionally I get a dialog stating "Could not determine activity to run because the generated manifest could not be found?
I occasionally see the wrong activity on startup.
I think this generally seems to be when I haven't changed any code and try to restart my application for a second debugging session.
I think what happens in this case, it that Android tries to restart my application on the page/Activity where I last left it. This situation also happens when the app is in general use - so it's good practice to write your code so that the app works in this situation (e.g. using the saved instance state bundle)

AIR for Mobile: how to debug MultiTouch?

Is there any way to simulate touch events in ADL? If not, how do you properly debug an application that heavily relies on touch events?
Using a device seems to be the best way, though it also appears this overlaps a previous SO question that describes the same issue in the normal Android Emulator: Is there any way to test multi-touch on the Android Emulator?
Also with regard to code testing you can still write unit tests to test out your objects/methods and verify they have the appropriate input and output. If you're so inclined as to do so you could even have it dispatch events from UI components using code like
//in your code
Multitouch.inputMode=MultitouchInputMode.GESTURE;
someComponent.addEventListener(GestureEvent.GESTURE_TWO_FINGER_TAP, someHandler);
//and in your test
someComponent.dispatchEvent(new GestureEvent(GestureEvent.GESTURE_TWO_FINGER_TAP));
//verify appropriate change occured after a timeout or something of that nature
and should be able to get the appropriate reaction to the event.
more on gesture events here:
http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa93023c59dfc1257b16a3d6-7ffd.html
more on multi-touch/gestures here as well:
http://www.adobe.com/devnet/flash/articles/multitouch_gestures.html
You can create multitouch app , run it on Your mobile and send Touch from device using WIFI .
This is how Im testing this .
But You can also write emulator that will read MouseEvents from stage and dispatch TouchEvents .

Resources