Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6_0_X][TIMOB-24497][TIMOB-24316][TIMOB-24527] Backport #8910

Merged
merged 7 commits into from Apr 21, 2017

Conversation

Copy link
Contributor

@maggieaxway maggieaxway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR FT PASS

Test case here: #8908

@hansemannn hansemannn added this to the 6.0.4 milestone Mar 29, 2017
@bert-w
Copy link

bert-w commented Apr 5, 2017

having issues with this. android:launchMode="standard" in my manifest.

As soon as I install the app from scratch, it seems to open two instances/activities (i see my splash screen pop in and pop out). On the second launch, it hangs on the splash screen. I've tried android:launchMode="singleTask" as well.

EDIT: after exitting the app completely due to the above freeze, I am able to start it up as expected.

Also, launching a custom URL scheme intent to the app which is in background will not work (hangs on splash screen, and seems to open a new instance while it was actually in background). Completely closing the app and then clicking a custom URL scheme DOES seem to work correctly

@garymathews
Copy link
Contributor Author

@Bertuzb I have updated this PR, please note that you cannot use android:launchMode with Titanium.

If you want android:launchMode="singleTask" behaviour, define:

<property name="intent-filter-new-task" type="bool">true</property>

in your tiapp.xml

@garymathews garymathews force-pushed the backport_24497_24316_24527 branch 2 times, most recently from 13138e3 to 87a6fab Compare April 5, 2017 21:54
@bert-w
Copy link

bert-w commented Apr 6, 2017

Ok the custom URL scheme seems to work now, regardless of background status or if app was closed (probably the intent-filter-new-task did the trick?).

However I see just one issue, which is a double splash screen (it seems to open two instances/activities) as soon as I install my app using appc ti build. It will not pass the splash screen.
After quiting the app, I can start it up as expected (and showing a single splash screen), and it all seems to work.

Note: I have not tested 87a6fab since I have no means to compile this SDK (im using the build which was compiled 2d ago, see comment https://jira.appcelerator.org/browse/TIMOB-15253)

@jonesdhtx
Copy link

@Bertuzb Bertuzb - It is failing for us with 2 different scenarios as described below, can you verify these happen for you as well?

(Note: I am using the same test build you referenced https://jira.appcelerator.org/browse/TIMOB-15253)

Previously, with the 6.0.3.GA release I was getting this:

  1. From initial state with app not running - In the phone browser click on a link in a test html page
    eg: <a href="testapp://order/11112222">Launch App</a>
  2. Our app opens successfully and handles the link accordingly
  3. Now leaving app open, return to the test html page, and click on the same link again
  4. Our app ux hangs and shows only the splash screen (BROKE)

New Issue #1: Now with the updated build applied, I am getting this:

  1. From initial state with app not running - In the phone browser click on a link in a test html page
    eg: <a href="testapp://order/11112222">Launch App</a>
  2. Our app opens successfully and handles the link accordingly
  3. Now leaving app open, return to the test html page, and click on the same link again
  4. Our app now opens successfully and handles the link accordingly (WORKS NOW!)
  5. Repeat steps 3 and 4 any number of times and note it continues to work as expected
  6. Now still leaving app open - return to the test html page and click on a different link this time:
    eg: <a href="testapp://order/33334444">Launch App</a>
  7. Our app ux now hangs and shows only the splash screen (BROKE)

New Issue #2: I noticed that it will fail in the same way if the app is open explicitly by the user before the initial link click:

  1. From initial state with app not running - start the app from the app launcher
  2. With the app launched and running normally, leave it open and then in the phone browser click on a link in a test html page
    eg: <a href="testapp://order/11112222">Launch App</a>
  3. Our app ux now hangs and shows only the splash screen (BROKE)

@garymathews - Could the 87a6fab change possibly address the issues I'm seeing?

Here is snippet of our tiapp.xml

<ti:app xmlns:ti="http://ti.appcelerator.org">
    ...
    <property name="run-on-main-thread" type="bool">true</property>
    <property name="intent-filter-new-task" type="bool">true</property>
    ...
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest android:versionCode="16">
            <application android:hardwareAccelerated="true"
                android:largeHeap="true" android:theme="@style/Theme.Titanium">
                <activity android:name=".TestAppActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTask">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    </intent-filter>
                    <intent-filter>
                        <action android:name="android.intent.action.VIEW"/>
                        <category android:name="android.intent.category.DEFAULT"/>
                        <category android:name="android.intent.category.BROWSABLE"/>
                        <data android:scheme="testapp" />
                    </intent-filter>
                </activity>
                <activity
                    android:configChanges="keyboardHidden|orientation"
                    android:hardwareAccelerated="true" android:name="io.card.payment.CardIOActivity"/>
                <activity android:name="io.card.payment.DataEntryActivity"/>
            </application>
            <uses-permission android:name="android.permission.CAMERA"/>
            <uses-permission android:name="android.permission.VIBRATE"/>
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
            <uses-feature android:name="android.hardware.location.gps"/>
            <uses-feature android:name="android.hardware.camera" android:required="false"/>
            <uses-feature
                android:name="android.hardware.camera.autofocus" android:required="false"/>
            <uses-feature android:name="android.hardware.camera.flash" android:required="false"/>
        </manifest>
    </android>
    ...
    <sdk-version>6.0.4.custom-preview</sdk-version>
    <plugins>
        ...
        <plugin version="1.0">ti.alloy</plugin>
        <plugin>hyperloop</plugin>
        ...
    </plugins>
    ...
</ti:app>

@garymathews
Copy link
Contributor Author

garymathews commented Apr 6, 2017

@jonesdhtx Remove android:launchMode="singleTask" from your tiapp.xml and test again?

Here's a build with 87a6fab: 6.0.4_20170406.zip

@jonesdhtx
Copy link

@garymathews - Removing the android:launchMode setting had no effect, still getting both issues

@bert-w
Copy link

bert-w commented Apr 6, 2017

@jonesdhtx I cannot reproduce #1 or #2. Different URLs seem to work as intended for me. Note Im not using run-on-main-thread (I have not researched yet why one would want to use this setting, any idea?). However, my app does freeze when I build it from scratch (and its auto-launched) as previously mentioned.

Also I am now seeming to get multiple intent triggers while opening the same URL when simply resuming the app from background. Not to mention the fact that I'm confused by the naming of "intent-filter-new-task" because it seems to me everyone would want to use the same task.

Here's my tiapp.xml snippet:

...
<property name="intent-filter-new-task" type="bool">true</property>
...
<android xmlns:android="http://schemas.android.com/sapk/res/android">
        <manifest android:versionCode="18" android:versionName="2.1.5"
            package="com.myapp" xmlns:android="http://schemas.android.com/apk/res/android">
            <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
            <uses-feature android:name="android.hardware.location" android:required="false"/>
            <application android:debuggable="false"
                android:hardwareAccelerated="true"
                android:icon="@drawable/appicon"
                android:label="MYAPP"
                android:largeHeap="true" android:theme="@style/Theme.Custom">
                <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
                <activity android:label="@string/app_name"
                    android:launchMode="standard"
                    android:name=".MYAPP" android:theme="@style/Theme.Titanium">
                    <intent-filter>
                        <action android:name="android.intent.action.VIEW"/>
                        <category android:name="android.intent.category.DEFAULT"/>
                        <category android:name="android.intent.category.BROWSABLE"/>
                        <data android:scheme="myapp"/>
                    </intent-filter>
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    </intent-filter>
                </activity>
            </application>
        </manifest>
    </android>

@garymathews garymathews force-pushed the backport_24497_24316_24527 branch 2 times, most recently from 8b5fdee to ddc37c0 Compare April 6, 2017 13:16
@jonesdhtx
Copy link

@garymathews - After playing around with it some more, I'm thinking the reason you weren't seeing the problem before might have to do with the use of back button vs home button (or task switcher)?

More info & link to sample project posted here: https://jira.appcelerator.org/browse/TIMOB-15253?focusedCommentId=417491&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-417491

@lokeshchdhry
Copy link
Contributor

lokeshchdhry commented Apr 21, 2017

FR Passed.

TIMOB-24497:

  1. Ran the test code & verified it does not show any issues & runs as expected.

TIMOB-24316:

  1. Ran specified steps & checked if PR fixes customer issue.

TIMOB-24527:

  1. Checked applications like Gmail which use intents using FLAG_ACTIVITY_NEW_DOCUMENT work properly & as expected,.

Studio Ver : 4.8.1.201612050850
SDK Ver : 6.0.4 local build
OS Ver : 10.12.3
Xcode Ver : Xcode 8.3.2
Appc NPM : 4.2.9
Appc CLI : 6.2.0
Ti CLI Ver : 5.0.12
Alloy Ver : 1.9.11
Node Ver : 6.10.1
Java Ver : 1.8.0_101
Devices : google Nexus 6P --- Android 7.1.1
google Nexus 6 --- Android 6.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants