Hi,

I've build an Android app that uses the pushwoosh services. The device registration proces works perfectly. I can receive push notifications without a problem. But when i click (or tap) the notification on my phone the app won't open correctly. I see that the app is launched (in the active app list) but it doesn't show the app as it would when you normally start the app by tapping the app icon. On a older Android model i used to get a warning in my Titanium Studio console about a missing ".MESSAGE" activity. Could this be the problem? If so, what should i add to my tiapp.xml in order for it to work.

I've been searching a couple of hours now and starting to get the impression that i'm the only one with this problem... Now a days that's almost impossible because everything has been done already ;-)

Please share your thoughts.

Thanks!

Grtz,

Erik

asked 17 Apr '14, 10:03
ibizzdevelopers's gravatar image

ibizzdevelopers
1112

Hello,

Could you please try to add the following code in android -> manifest -> application tag?

<activity
    android:name=".InruilautoserviceActivity"
    android:label="activity_label"
    android:theme="@style/Theme.Titanium"
    android:launchMode="singleTop"
    android:configChanges="keyboardHidden|orientation">
    <intent-filter>
        <action android:name="com.autorola.inruilautoservice.MESSAGE" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

Please let us know about the results!

permanent link
answered 18 Apr '14, 08:44
Shmakov's gravatar image

Shmakov
1762

Hi,

I added the XML and it sort of works. If the app is not running and i tap the push notification the app opens. Great :-) If the app is running in the background and i tap the push notification the app wants to open but crashes or stalls on launch.

Thanks for your solution. I'm a step closer to the final product. Maybe it's a good idea to put the piece of XML in the Titanium example implementation.

Grtz,

Erik

permanent link
answered 19 Apr '14, 15:31
ibizzdevelopers's gravatar image

ibizzdevelopers
1112

Hello,

The missing .message activity certainly might be the problem!

Could you please send us the tiapp.xml file? Our developers will look through it and provide some recommendations. Please note that you can create a ticket in our support system using the Contact Us form on our website.

permanent link
answered 17 Apr '14, 10:21
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev
3.7k7

Hi Dmitry,

Thanks for your reply :-) Here is my tiapp.xml


<ti:app xmlns:ti="http://ti.appcelerator.org">
    <id>com.autorola.inruilautoservice</id>
    <name>Inruilautoservice</name>
    <version>1.0</version>
    <publisher>ietjesmulders</publisher>
    <url>http://www.inruilautoservice.nl</url>
    <description>not specified</description>
    <copyright>2014 by ietjesmulders</copyright>
    <icon>appicon.png</icon>
    <fullscreen>false</fullscreen>
    <navbar-hidden>false</navbar-hidden>
    <analytics>true</analytics>
    <guid>405bea56-396f-45e2-8a6f-c33bdd3db55a</guid>
    <property name="ti.ui.defaultunit" type="string">dp</property>
    <ios>
        <prerendered-icon>false</prerendered-icon>
        <plist>
            <dict>
                <key>UISupportedInterfaceOrientations~iphone</key>
                <array>
                    <string>UIInterfaceOrientationPortrait</string>
                </array>
                <key>UISupportedInterfaceOrientations~ipad</key>
                <array>
                    <string>UIInterfaceOrientationPortrait</string>
                    <string>UIInterfaceOrientationPortraitUpsideDown</string>
                </array>
                <key>UIRequiresPersistentWiFi</key>
                <false/>
                <key>UIStatusBarHidden</key>
                <false/>
                <key>UIStatusBarStyle</key>
                <string>UIStatusBarStyleDefault</string>
                <key>UIPrerenderedIcon</key><false/>
            </dict>
        </plist>
    </ios>
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <supports-screens android:anydensity="false"/>

              <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
              <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
              <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
              <uses-permission android:name="android.permission.INTERNET"/>
              <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
              <uses-permission android:name="android.permission.WAKE_LOCK"/>
              <uses-permission android:name="com.autorola.inruilautoservice.permission.C2D_MESSAGE"/>
              <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
              <permission android:name="com.autorola.inruilautoservice.permission.C2D_MESSAGE" android:protectionlevel="signature"/>
              <uses-sdk android:minsdkversion="10" android:targetsdkversion="16"/>
              <application>
                  <activity android:name="com.arellomobile.android.push.PushWebview"/>
                  <activity android:name="com.arellomobile.android.push.MessageActivity"/>
                  <activity android:name="com.arellomobile.android.push.PushHandlerActivity"/>
                  <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
                      <intent-filter>
                          
                          <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
                          
                          <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
                          <category android:name="com.autorola.inruilautoservice"/>
                      </intent-filter>
                  </receiver>
                  <service android:name="com.arellomobile.android.push.PushGCMIntentService"/>
              </application>
        </manifest>
    </android>
    <mobileweb>
        <precache/>
        <splash>
            <enabled>true</enabled>
            <inline-css-images>true</inline-css-images>
        </splash>
        <theme>default</theme>
    </mobileweb>
    <modules>
        <module platform="android">com.arellomobile.push</module>
    </modules>
    <deployment-targets>
        <target device="android">true</target>
        <target device="blackberry">false</target>
        <target device="ipad">true</target>
        <target device="iphone">true</target>
        <target device="mobileweb">false</target>
        <target device="tizen">false</target>
    </deployment-targets>
    <sdk-version>3.2.2.GA</sdk-version>
    <plugins>
        <plugin version="1.0">ti.alloy</plugin>
    </plugins>
</ti:app>
permanent link
answered 17 Apr '14, 11:53
ibizzdevelopers's gravatar image

ibizzdevelopers
1112

This works for me.

But how make the push always open the app, even if the app is suspend (in background by home button) ?

permanent link
answered 18 Apr '14, 23:56
fukhaos's gravatar image

fukhaos
14

Hi,

I've implemented this solution. But when the app is on foreground and I tap on a new notification received, the app starts but it freezes on splash screen. It seems to be the app doesn't find any activity to start. Anybody knows if I'm missing something? My AndroidManifest.xml generated is the following:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.semseoymas.socialshared" android:versioncode="1" android:versionname="1.0"> <uses-sdk android:minsdkversion="10" android:targetsdkversion="19"/> <application android:icon="@drawable/appicon" android:label="Social Shared Corporate" android:name="SocialSharedCorporateApplication" android:debuggable="false"> <activity android:name=".SocialSharedCorporateActivity" android:label="Social Shared Corporate" android:theme="@style/Theme.Titanium" android:launchmode="singleTop" android:configchanges="keyboardHidden|orientation|screenSize"> <intent-filter> <action android:name="com.semseoymas.socialshared.MESSAGE"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name="org.appcelerator.titanium.TiActivity" android:configchanges="keyboardHidden|orientation|screenSize"/> <activity android:name="org.appcelerator.titanium.TiTranslucentActivity" android:configchanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Translucent"/> <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" android:configchanges="screenSize"/> <activity android:name="com.arellomobile.android.push.PushWebview" android:configchanges="screenSize"/> <activity android:name="com.arellomobile.android.push.MessageActivity" android:configchanges="screenSize"/> <activity android:name="com.arellomobile.android.push.PushHandlerActivity" android:configchanges="screenSize"/> <service android:name="org.appcelerator.titanium.analytics.TiAnalyticsService" android:exported="false"/> <service android:name="com.arellomobile.android.push.PushGCMIntentService"/> <service android:name="com.arellomobile.android.push.GeoLocationService"/> <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE"/> <action android:name="com.google.android.c2dm.intent.REGISTRATION"/> <category android:name="com.semseoymas.socialshared"/> </intent-filter> </receiver> </application> <supports-screens android:anydensity="false"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.BROADCAST_STICKY"/> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/> <uses-permission android:name="com.semseoymas.socialshared.permission.C2D_MESSAGE"/> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <permission android:name="com.semseoymas.socialshared.permission.C2D_MESSAGE" android:protectionlevel="signature"/> </manifest>

And in my app.js I have:

pushnotifications.pushNotificationsRegister(Ti.App.sc.gcm_project_id, Ti.App.sc.push_woosh_code, {
            //NOTE: all the functions fire on the background thread, do not use any UI or Alerts here
            success:function(e)
            {
                Ti.API.info('TITAIUM!!! JS registration success event: ' + e.registrationId);
            },
            error:function(e)
            {
                Ti.API.error("TITAIUM!!! Error during registration: "+e.error);
            },
            callback:function(e) // called when a push notification is received
            {
                Ti.API.info('TITAIUM!!! Notification received: ' + JSON.stringify(e.data));
            }
        });
permanent link
answered 14 Jul '14, 12:54
fcjurado's gravatar image

fcjurado
2115

edited 14 Jul '14, 13:07

ibizzdevelopers(Erik)

Did you get it done?

I'm having the exactly same issue

permanent link
answered 14 Oct '16, 18:45
joao's gravatar image

joao
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×447
×446
×30

question asked: 17 Apr '14, 10:03

question was seen: 9,822 times

last updated: 14 Oct '16, 18:45