arleyandrada / PushClient

FREE and Open Source - Titanium PushClient Module
Other
44 stars 17 forks source link

App crash in background. #131

Closed maxiannunziata closed 8 years ago

maxiannunziata commented 8 years ago

Hi buddy,

When i send a push notification from my server, the app crash when is in background (Android).

android:targetSdkVersion="23"

5.1.2.GA

PushClient : 1.14

Ti Console

[INFO] :   AppCompatDelegate: The Activity's LayoutInflater already has a Factory installed so we can not install AppCompat's
[ERROR] :  Surface: getSlotFromBufferLocked: unknown buffer: 0xb82cbf40
[ERROR] :  Surface: getSlotFromBufferLocked: unknown buffer: 0xb851f5a8
[ERROR] :  Surface: getSlotFromBufferLocked: unknown buffer: 0xb8514078

PHP

// prep the bundle
$data = array('message' => 'Hello World!');

// The recipient registration tokens for this notification
// https://developer.android.com/google/gcm/    

  $post = array(
                    'registration_ids'  => $registrationIds,
                    'data'              => $data,
                 );

Any idea?

maxiannunziata commented 8 years ago

ok, i found the error. `// prep the bundle

$data = array('alert' => 'Hello World!',
'sound' => 'default',
'notificationId' => '1',
'body' => 'Hello World!',
'title' => 'Hello World!',
'ticker' => 'Hello World!',
'smallIcon' => 'defa',
'category' => 'defa',
maxiannunziata commented 8 years ago

The device registration process works perfectly. I can receive push notifications without a problem. But when i click (or tap) the notification on my phone the app crash.

Any idea? :/

arleyandrada commented 8 years ago

I have no idea just with this info. Maybe with some console info and error messages.

arleyandrada commented 8 years ago

The module is now free and open source.

maxiannunziata commented 8 years ago

The module is now free and open source.

Thanks for this!

Ok, I could solve the problem, I leave details to help another person

From Android Device Monitor console:

07-18 11:40:48.761: E/TiLaunchActivity(3134): (main) [14653,15066] Android issue 2373 detected (missing intent CATEGORY_LAUNCHER or FLAG_ACTIVITY_RESET_TASK_IF_NEEDED), restarting app

I added this in tiapp.xml:

<property name="ti.android.bug2373.finishfalseroot" type="bool">true</property>

and gone!

arleyandrada commented 8 years ago

Thanks!