Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Easy Local Android Notifications

Discussion in 'Assets and Asset Store' started by CarlosFM, Jul 2, 2013.

  1. xsodus

    xsodus

    Joined:
    Jun 5, 2012
    Posts:
    14
    Oh. I see. I think my bundle id is mismatch. Let's me try to change it. I will reply soon.
     
  2. xsodus

    xsodus

    Joined:
    Jun 5, 2012
    Posts:
    14
    First, I test with empty project
    My bundle ID
    $Id.png

    My AndroidMenifest.xml
    <?xml version="1.0" encoding="utf-8"?>
    <!-- substitute package for your own -->
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal"
    package="com.testing.myapp"
    android:versionName="1.00"
    android:versionCode="1">

    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" android:xlargeScreens="true" />

    <application android:label="@string/app_name" android:icon="@drawable/app_icon" android:debuggable="true">


    <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="@string/app_name"
    android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name"
    android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    </activity>

    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name"
    android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    <meta-data android:name="android.app.lib_name" android:value="unity" />
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    </activity>

    <!-- ELAN java -->
    <service android:enabled="true" android:name="com.CFM.ELAN.ELANAlarmCreator" />
    <receiver android:name="com.CFM.ELAN.TimedAlarm" />
    <!-- end -->

    </application>

    <!-- <uses-sdk android:minSdkVersion="9" /> -->

    </manifest>

    But i found the same problem. please see log.

    [Android Log]
    D/AudioResampler( 143): forcing AudioResampler quality to 3
    D/LvOutput( 143): initCheck: 0
    D/LvOutput( 143): detachEffects: detach processing for output 2, stream 1, sess
    ion 247
    D/LvOutput( 143): detachEffects: no output processing was attached to this stre
    am
    D/LvOutput( 143): initCheck: 0
    D/LvOutput( 143): attachEffects: attach processing to output 2, stream 1, sessi
    on 248, mode 0
    D/LvOutput( 143): attachEffects: no output processing needs to be attached to t
    his stream
    W/MemoryDealer( 143): madvise(0x435ad000, 12288, MADV_REMOVE) returned Operatio
    n not supported on transport endpoint
    D/ViewRootImpl( 568): ViewRoot TouchDown(Absolute) DOWN (492 , 913)
    D/AudioResampler( 143): forcing AudioResampler quality to 3
    W/IInputConnectionWrapper(17200): getCursorCapsMode on inactive InputConnection
    W/IInputConnectionWrapper(17200): getCursorCapsMode on inactive InputConnection
    V/xt9input_alpha( 568): alpha_finish()...
    V/xt9input_alpha( 568): alpha_data::DLM::flush() - allocationSize - 2048
    V/xt9input_alpha( 568): alpha_data::DLM::flush() - actualUsedSize - 16
    V/xt9input_alpha( 568): alpha_finish()...success
    V/xt9input_alpha( 568): alpha_start(context(0x5A486680))...
    V/xt9input_alpha( 568): alpha_start()...success
    V/xt9input_alpha( 568): alpha_setLanguage(context(0x5A486680))...
    V/xt9input_alpha( 568): alpha_data::setLanguage(0x109):set...ok
    V/xt9input_alpha( 568): alpha_setLanguage(context(0x5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_controller::setAutoCorrectionMode(3)
    V/xt9input_alpha( 568): alpha_data::setRegionalCorrection(OX9FF) - status(29)
    V/xt9input_alpha( 568): alpha_data::setSpellCorrectionMode(1)...status = 0x0
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_controller::setNextWordPrediction(0)
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_data::setWordCompletionPoint(0x1)...status = 0x0
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))...
    V/xt9input_dbregistry( 568): DBRegistry::get_ldb_path(0x0109)...LG_902_r1-16_EN
    ubUN_xt9_ALM.ldb
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))... 0x0109=>1
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))...
    V/xt9input_dbregistry( 568): DBRegistry::get_ldb_path(0x0109)...LG_902_r1-16_EN
    ubUN_xt9_ALM.ldb
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))... 0x0109=>1
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))...
    V/xt9input_dbregistry( 568): DBRegistry::get_ldb_path(0x0109)...LG_902_r1-16_EN
    ubUN_xt9_ALM.ldb
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))... 0x0109=>1
    D/LvOutput( 143): initCheck: 0
    D/LvOutput( 143): detachEffects: detach processing for output 2, stream 1, sess
    ion 248
    D/LvOutput( 143): detachEffects: no output processing was attached to this stre
    am
    D/wpa_supplicant( 466): nl80211: survey data missing!
    I/WindowManager( 347): # scancode : 172
    D/WindowManager( 347): mHomePressed = false down=true mHomekeypressedwhilescre
    enoff=false
    I/WindowManager( 347): # scancode : 172
    D/WindowManager( 347): Process launchHomeFromHotKey
    D/WindowManager( 347): mHomePressed = true down=false mHomekeypressedwhilescre
    enoff=false
    I/ActivityManager( 347): START {act=android.intent.action.MAIN cat=[android.int
    ent.category.HOME] flg=0x10200000 cmp=com.lge.launcher2/.Launcher u=0} from pid
    347
    D/dalvikvm( 481): GC_CONCURRENT freed 2540K, 57% free 14028K/32175K, paused 14m
    s+5ms, total 108ms
    D/dalvikvm( 481): WAIT_FOR_CONCURRENT_GC blocked 46ms
    W/ActivityManager( 347): Activity pause timeout for ActivityRecord{42ea0148 com
    .testing.myapp/com.unity3d.player.UnityPlayerNativeActivity}
    I/[LGHome]EVENT( 656): [Launcher.java:3708:eek:nNewIntent()]Home Key Pressed
    I/[LGHome]EVENT( 656): [Launcher.java:10779:eek:nStart()]onStart
    I/[LGHome]EVENT( 656): [Launcher.java:2029:eek:nResume()]onResume
    I/[LGHome]Launcher( 656): [Launcher.java:8843:notifyToWeatherWidget()]broadcast
    to weather widget, intent: Intent { act=com.lge.launcher2.RESUME } :: false
    I/[LGHome]Launcher( 656): [Launcher.java:1579:setOrientation()]setOrientation
    D/WeatherAncestor(12895): onReceive, action: com.lge.launcher2.RESUME, Time(hour
    :min:sec) 16:34:8
    I/[LGHome]EVENT( 656): [Launcher.java:2274:eek:nResume()]onResume end
    D/UpdateThreadPoolManager(12895): This is isUpdating : false
    D/WeatherAncestor(12895): shouldTimeTickRegistered().........
    D/WeatherService(12895): TimeTick Receiver Register
    D/SurfaceFlinger( 140): createSurface for (540 x 960), name=com.lge.launcher2/c
    om.lge.launcher2.Launcher
    D/WeatherAncestor(12895): onReceive has processed, action: com.lge.launcher2.RES
    UME, Time(hour:min:sec) 16:34:8
    D/WeatherService(12895): onStartCommand, intent!=null, action: com.lge.launcher2
    .RESUME
    D/WeatherService(12895): onStartCommand, intent!=null, action: com.lge.weather.W
    IDGET_REFRESH
    D/WeatherService(12895): requestRefreshAppWidget, isUpdateStart : false
    D/UpdateThreadPoolManager(12895): This is isUpdating : false
    D/WeatherService(12895): requestRefreshAppWidget, isUpdating : false
    D/WeatherAncestor(12895): buildUpdate, appWidgetId: 2
    D/WeatherReflect(12895): Map key string is -2
    D/lim (12895): time = 16:34
    I/WeatherReflect(12895): Model Name : LG-P768
    D/Theme (12895): strTheme: com.lge.launcher2
    D/WeatherTheme(12895): package is not available: com.lge.sizechangable.weather.t
    heme.optimus
    D/LvOutput( 143): initCheck: 0
    D/LvOutput( 143): detachEffects: detach processing for output 2, stream 3, sess
    ion 245
    D/LvOutput( 143): detachEffects: no output processing was attached to this stre
    am
    D/Unity (17200): onDetachedFromWindow
    D/bsthal ( 347): setDelay, handle: 1598182229 delay: 66667000
    I/bsthal ( 347): <BST> set delay of <BOSCH BMC050 Acceleration Sensor> to 66ms

    D/bsthal ( 347): activate, handle: 1598182230, enabled: 0
    I/bsthal ( 347): <BST> disable sensor <BOSCH BMC050 Magnetic Field Sensor>
    D/bsthal ( 347): setDelay, handle: 1598182230 delay: 20000000
    I/bsthal ( 347): <BST> set delay of <BOSCH BMC050 Magnetic Field Sensor> to 20
    ms
    W/MemoryDealer( 143): madvise(0x4404b000, 12288, MADV_REMOVE) returned Operatio
    n not supported on transport endpoint
    V/xt9input_alpha( 568): alpha_setLanguage(context(0x5A486680))...
    V/xt9input_alpha( 568): alpha_data::setLanguage(0x109):set...ok
    V/xt9input_alpha( 568): alpha_setLanguage(context(0x5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_controller::setAutoCorrectionMode(3)
    V/xt9input_alpha( 568): alpha_data::setRegionalCorrection(OX9FF) - status(29)
    V/xt9input_alpha( 568): alpha_data::setSpellCorrectionMode(1)...status = 0x0
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_controller::setNextWordPrediction(0)
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...
    V/xt9input_alpha( 568): alpha_data::setWordCompletionPoint(0x1)...status = 0x0
    V/xt9input_alpha( 568): alpha_setAttribute(context(5A486680))...success
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))...
    V/xt9input_dbregistry( 568): DBRegistry::get_ldb_path(0x0109)...LG_902_r1-16_EN
    ubUN_xt9_ALM.ldb
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))... 0x0109=>1
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))...
    V/xt9input_dbregistry( 568): DBRegistry::get_ldb_path(0x0109)...LG_902_r1-16_EN
    ubUN_xt9_ALM.ldb
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))... 0x0109=>1
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))...
    V/xt9input_dbregistry( 568): DBRegistry::get_ldb_path(0x0109)...LG_902_r1-16_EN
    ubUN_xt9_ALM.ldb
    V/xt9input_alpha( 568): alpha_hasLdb(context(0x5A486680))... 0x0109=>1
    D/wpa_supplicant( 466): nl80211: survey data missing!
    D/AlarmManager( 347): Triggering ELAPSED_REALTIME_WAKEUP with Alarm{42b69ee0 ty
    pe 2 com.google.android.gms}
    D/bsthal ( 347): setDelay, handle: 1598182229 delay: 66667000
    I/bsthal ( 347): <BST> set delay of <BOSCH BMC050 Acceleration Sensor> to 66ms

    D/bsthal ( 347): setDelay, handle: 1598182229 delay: 1000000
    I/bsthal ( 347): <BST> set delay of <BOSCH BMC050 Acceleration Sensor> to 1ms
    D/bsthal ( 347): setDelay, handle: 1598182229 delay: 66667000
    I/bsthal ( 347): <BST> set delay of <BOSCH BMC050 Acceleration Sensor> to 66ms

    I/[LGHome]NumberBadge.LGUnreadLgeEmailsBadge( 656): [LGUnreadLgeEmailsBadge.jav
    a:147:countUnreadItems()]countUnreadItems() started..
    I/[LGHome]NumberBadge.LGUnreadLgeEmailsBadge( 656): [LGUnreadLgeEmailsBadge.jav
    a:155:countUnreadItems()]Clear the count of number badge because the account is
    none
    I/[LGHome]NumberBadge.LGBroadCastBadge( 656): [LGBroadCastBadge.java:55:updateB
    adgeIcon()][updateClassList : com.lge.appbox.client.AppBoxClient = 1
    I/[LGHome]NumberBadge.LGBroadCastBadge( 656): [LGBroadCastBadge.java:55:updateB
    adgeIcon()][updateClassList : jp.naver.line.android.activity.SplashActivity = 0
    D/AlarmManager( 347): Triggering RTC_WAKEUP with Alarm{427d5ed0 type 0 com.test
    ing.myapp}
    D/PhoneStatusBar( 481): addNotification score=0
    D/SizeAdaptiveLayout( 481): com.android.internal.widget.SizeAdaptiveLayout@4250
    8120child view android.widget.FrameLayout@422f5e20 measured out of bounds at 92p
    x clamped to 96px
    D/audio_hw_primary( 143): Call pcm_close() PCM_OUT
    D/wpa_supplicant( 466): nl80211: survey data missing!
    D/ViewRootImpl( 656): ViewRoot TouchDown(Absolute) DOWN (332 , 67)
    D/AbstractBrightness( 481): Current(177) is BRIGHTNESS_CUSTOM
    D/AbstractBrightness( 481): thermal max bright read fail
    D/ViewRootImpl( 481): ViewRoot TouchDown(Absolute) DOWN (344 , 25)
    D/AbstractBrightness( 481): Current(177) is BRIGHTNESS_CUSTOM
    D/AbstractBrightness( 481): thermal max bright read fail
    D/AbstractBrightness( 481): Current(177) is BRIGHTNESS_CUSTOM
    D/AbstractBrightness( 481): thermal max bright read fail
    D/AbstractBrightness( 481): Current(177) is BRIGHTNESS_CUSTOM
    D/AbstractBrightness( 481): thermal max bright read fail
    D/PhoneStatusBar( 481): disable() mDisabled: 0x00080000
    D/PhoneStatusBar( 481): disable: < expand icons alerts TICKER* system_info back
    home recent clock >
    D/QuickSettingsItemList( 481): setAllButtonsStatus()
    D/QuickSettingsItemList( 481): applicationLabelResourceId: 2131165184
    D/QuickSettingsItemList( 481): applicationLabelResourceId: 2131165184, label: Q
    uickMemo
    D/AirplaneHandler( 481): setAirplaneButton!!!
    D/AbstractBrightness( 481): Current(177) is BRIGHTNESS_CUSTOM
    D/BrightHandler( 481): updateBrightnessButton, BRIGHTNESS_CUSTOM
    D/EcoHandler( 481): Current content://settings/system/eco_mode : 0
    D/GpsHandler( 481): setGPSButton()
    D/HotspotHandler( 481): setHotspotButton:: !!!
    D/LteHandler( 481): isLteOnly? 0
    D/LteHandler( 481): isLteEnabled? 0
    D/LteHandler( 481): LTE Network disabled.
    D/PowerSaverHandler( 481): Current content://settings/system/power_save_enabled
    : 0
    D/PowerSaverHandler( 481): Current content://settings/system/power_save_mode :
    30
    D/QMemoHandler( 481): refreshButton()
    V/LGPhoneStatusBar( 481): noti expanded BC sent
    D/wpa_supplicant( 466): nl80211: survey data missing!
    D/KeyguardUpdateMonitor( 347): received broadcast android.intent.action.BATTERY
    _CHANGED
    D/KeyguardUpdateMonitor( 347): handleBatteryUpdate (2) (100)
    D/SizeAdaptiveLayout( 481): com.android.internal.widget.SizeAdaptiveLayout@424d
    a278child view android.widget.RelativeLayout@4251eba0 measured out of bounds at
    92px clamped to 96px
    D/wpa_supplicant( 466): nl80211: survey data missing!
    D/ViewRootImpl( 481): ViewRoot TouchDown(Absolute) DOWN (203 , 608)
    I/ActivityManager( 347): START {cmp=com.testing.myapp/com.unity3d.player.UnityP
    layerActivity bnds=[0,568][540,660] u=0} from pid -1
    W/ActivityManager( 347): startActivity called from non-Activity context; forcin
    g Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.testing.myapp/com.unity3d.
    player.UnityPlayerActivity bnds=[0,568][540,660] }
    I/[LGHome]EVENT( 656): [Launcher.java:2282:eek:nPause()]onPause
    D/KeyguardViewMediator( 347): verifyUnlock
    W/KeyguardViewMediator( 347): verifyUnlock called when not externally disabled
    D/dalvikvm(17200): Trying to load lib /data/data/com.testing.myapp/lib/libmono.s
    o 0x42297558
    D/dalvikvm(17200): Shared lib '/data/data/com.testing.myapp/lib/libmono.so' alre
    ady loaded in same CL 0x42297558
    D/dalvikvm(17200): Trying to load lib /data/data/com.testing.myapp/lib/libunity.
    so 0x42297558
    D/dalvikvm(17200): Shared lib '/data/data/com.testing.myapp/lib/libunity.so' alr
    eady loaded in same CL 0x42297558
    D/AndroidRuntime(17200): Shutting down VM
    W/dalvikvm(17200): threadid=1: thread exiting with uncaught exception (group=0x4
    19e22a0)
    E/AndroidRuntime(17200): FATAL EXCEPTION: main
    E/AndroidRuntime(17200): java.lang.Error: FATAL EXCEPTION [main]
    E/AndroidRuntime(17200): Unity version : 4.1.5f1
    E/AndroidRuntime(17200): Device model : LGE LG-P768
    E/AndroidRuntime(17200): Device fingerprint: lge/u2_open_tha/u2:4.1.2/JZO54K/P76
    8f20c.4DEB3D0B:user/release-keys
    E/AndroidRuntime(17200):
    E/AndroidRuntime(17200): Caused by: java.lang.RuntimeException: Unable to start
    activity ComponentInfo{com.testing.myapp/com.unity3d.player.UnityPlayerActivity}
    : java.lang.NullPointerException
    E/AndroidRuntime(17200): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2070)
    E/AndroidRuntime(17200): at android.app.ActivityThread.handleLaunchActivi
    ty(ActivityThread.java:2095)
    E/AndroidRuntime(17200): at android.app.ActivityThread.access$600(Activit
    yThread.java:135)
    E/AndroidRuntime(17200): at android.app.ActivityThread$H.handleMessage(Ac
    tivityThread.java:1201)
    E/AndroidRuntime(17200): at android.os.Handler.dispatchMessage(Handler.ja
    va:99)
    E/AndroidRuntime(17200): at android.os.Looper.loop(Looper.java:137)
    E/AndroidRuntime(17200): at android.app.ActivityThread.main(ActivityThrea
    d.java:4849)
    E/AndroidRuntime(17200): at java.lang.reflect.Method.invokeNative(Native
    Method)
    E/AndroidRuntime(17200): at java.lang.reflect.Method.invoke(Method.java:5
    11)
    E/AndroidRuntime(17200): at com.android.internal.os.ZygoteInit$MethodAndA
    rgsCaller.run(ZygoteInit.java:795)
    E/AndroidRuntime(17200): at com.android.internal.os.ZygoteInit.main(Zygot
    eInit.java:562)
    E/AndroidRuntime(17200): at dalvik.system.NativeStart.main(Native Method)

    E/AndroidRuntime(17200): Caused by: java.lang.NullPointerException
    E/AndroidRuntime(17200): at com.unity3d.player.g.a(Unknown Source)
    E/AndroidRuntime(17200): at com.unity3d.player.g.b(Unknown Source)
    E/AndroidRuntime(17200): at com.unity3d.player.UnityPlayer.resume(Unknown
    Source)
    E/AndroidRuntime(17200): at com.unity3d.player.UnityPlayer.a(Unknown Sour
    ce)
    E/AndroidRuntime(17200): at com.unity3d.player.UnityPlayer.init(Unknown S
    ource)
    E/AndroidRuntime(17200): at com.unity3d.player.UnityPlayerActivity.onCrea
    te(Unknown Source)
    E/AndroidRuntime(17200): at android.app.Activity.performCreate(Activity.j
    ava:5236)
    E/AndroidRuntime(17200): at android.app.Instrumentation.callActivityOnCre
    ate(Instrumentation.java:1082)
    E/AndroidRuntime(17200): at android.app.ActivityThread.performLaunchActiv
    ity(ActivityThread.java:2034)
    E/AndroidRuntime(17200): ... 11 more
    W/ActivityManager( 347): Force finishing activity com.testing.myapp/com.unity
    3d.player.UnityPlayerActivity
    D/SurfaceFlinger( 140): createSurface for (1 x 1), name=Sorry!
    W/CursorWindow(16743): Window is full: requested allocation 916773 bytes, free s
    pace 901706 bytes, window size 2097152 bytes
    W/CursorWindow(16743): Window is full: requested allocation 916773 bytes, free s
    pace 901706 bytes, window size 2097152 bytes
    V/LGPhoneStatusBar( 481): noti collapsed BC sent
    D/PhoneStatusBar( 481): disable() mDisabled: 0x00000000
    D/PhoneStatusBar( 481): disable: < expand icons alerts ticker* system_info back
    home recent clock >
    W/ActivityManager( 347): Activity pause timeout for ActivityRecord{42398558 com
    .testing.myapp/com.unity3d.player.UnityPlayerActivity}
    D/wpa_supplicant( 466): nl80211: survey data missing!
     
  3. xsodus

    xsodus

    Joined:
    Jun 5, 2012
    Posts:
    14
    I found some strange case.
    If I close my app before touch on the notify message, It's work correctly.
     
  4. akkiDev

    akkiDev

    Joined:
    Aug 7, 2013
    Posts:
    70
    Have a look on this..

    I think its a better simple way to do all that stuff...

    Unity Push Notification
     
  5. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @akkiDev: that link shows how to do Push Notifications (messages to android devices originated OUTSIDE the phone, usually a server), which has very little to do with local notifications (messages that appear on your notification bar originated from WITHIN your phone).

    As per your error, xsodus, have you checked matching the bundle ID and the package name as suggested?
     
  6. xsodus

    xsodus

    Joined:
    Jun 5, 2012
    Posts:
    14
    @CarlosFM
    From my last test (empty project),
    I ran your demo scene and checked bundle ID and package name both AndroidMenifest.xml and Player->Other Settings .
    There are matched.
     
  7. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Mmm, that's not what your logcat says. Could you send me a copy of your empty project with ELAN, the one that is giving you trouble? I may be able to spot something there.

    Send it to my email: carlos.fernandez.musoles (at) gmail.com

    Thanks
     
  8. xsodus

    xsodus

    Joined:
    Jun 5, 2012
    Posts:
    14
    @CarlosFM
    I already sent an email.
     
  9. inburst

    inburst

    Joined:
    Jul 9, 2012
    Posts:
    4
    Hey Carlos,
    We are having some trouble with the way you make the call to start the app activity when a notification is selected. It Looks like you are trying to call 'UnityPlayerActivity' even when an activity of that name does not exist in the android manifest. We have our own custom activity which is an override of UnityPlayerActivity. How can we have the notifications routed to our custom activity?
    Also any time we launch our app from a notification we experience a large volume of visual bugs which we have never seen before. these include tons of missing textures and broken shaders.
    Thanks,
    Aaron
     
  10. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi inburst,

    This is a very bizarre case that has been reported a couple of times, and hence we have documented a solution in the latest version of the Guide:

    If you experience this issue (some of your textures going in the wrong places or darkening) after coming back to your app via the local notification, you must modify a bit the code that comes with ELAN to patch it. Apparently there are some strange things going on when any android activity extends the main unity activity: UnityPlayerActivity. If your app does it, or contains a plugin that does it, then you need to modify the behavior of ELAN when it handles tapping your notifications.
    In the TimedAlarm.java class, within the onReceive(...) method, change the PendingIntent content for the following:

    Code (csharp):
    1.  
    2. Class<?> c = null;
    3. try {
    4.       c = Class.forName("NAME_OF_YOUR_CLASS");
    5. } catch (ClassNotFoundException e) {
    6.       e.printStackTrace();
    7. }
    8. PendingIntent contentIntent =PendingIntent.getActivity(context, id, new Intent(context,c), 0);
    Where it reads "NAME_OF_YOUR_CLASS" you should enter the full qualified name of the main activity that extends UnityPlayerActivity (it must include the package name as well, so if your package name is com.CFM.ELAN, and your activity is MyOwnMainActivity, then enter "com.CFM.ELAN.MyOwnMainActivity").

    Once you've done this, recompile the project, create another ELAN.jar file and substitute the one that the package ships with with this one (it should be in Assets>Plugins>Android).
     
  11. inburst

    inburst

    Joined:
    Jul 9, 2012
    Posts:
    4
    Thanks for the response Carlos.
    It seems your latest version of the plugin does not ship with the source. I do not have the TimedAlarm.java class you mention or any android project I can use to re-compile the ELAN jar. Could you send me the project so I can do the patch you mention above?
    Thanks!
     
  12. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi

    The source code should be inside the ELAN.jar file. If you make a copy of it and rename the extension from jar to zip, you should be able to find them upon unzipping the classes (inside com/ELAN).

    If you still cannot find them, please send me a note to my email address and I will attach the classes.

    carlos.fernandez.musoles (at) gmail.com
     
  13. inburst

    inburst

    Joined:
    Jul 9, 2012
    Posts:
    4
    Thanks Carlos,
    Your patch worked like a charm!
     
  14. GermyGames

    GermyGames

    Joined:
    May 20, 2012
    Posts:
    38
    I sent an e-mail, but could you post a guide on building an updated JAR using the code that's there?
     
  15. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi GreatBigJerk,

    Sure, I'll try to make a quick write up on how to recompile the Jar file to fit your needs. The reason I didn't include it originally on the guide that comes with the package is because it wasn't needed -until we found out having an activity that extends the UnityPlayerActivity interferes somehow with the 'resume app' flow' -still a mistery to me, but hey, there is a workaround.

    To recompile my ELAN.Jar package (and for that matter, ANY jar file that comes with the source code) you have to follow these steps:

    1) Rename the file to ELAN.zip and unzip it to any place on your computer. You should see a folder named ELAN containing a couple of directories (com and MEFA-INF) and a couple of files (classes.jar and ELAN.drjava).

    2) If you don't have experience with a java IDE and compiling java code, I recommend you download Dr Java and install it on your computer, as it will be easier than Eclipse or other IDEs.

    3) Start Dr Java and go to Project->Open and select the ELAN.drjava file.

    4) You should see a tree with all the source code (com>CFM>ELAN); basically there are three classes: ELANAlarmCreator.java, ELANManager.java and TimedAlarm.java.

    5) Modify any part of the code as you see fit -follow the guide if your particular problem is the material mix-up.

    6) Now it's time to recompile! Before hitting compile, check that you are using a java compiler that is NOT a jdk 7.X (for some reason Unity does not like Jar files compiled with the latest compiler). You can select the compiler on the bottom right corner in Dr Java. Click on the 'Compile project' button on the top and wait until it finishes. When it does, go to Project->Create Jar File from Project.

    -> if you get compiler errors complaining about android classes, you need to link the android.jar library to your project. Download the android.jar from the Internet (it should come with the android SDK for java) and then within Dr java go to Project-> Project Properties and on the Extra Classpath section, click Add and then select the android.jar file. If you get complaints about Unity classes, do the same linking with the classes.jar file you found when unzipping ELAN

    7) Now in the Create Jar File from Project window, Select Jar all files and then name your file in the Jar File section (ELAN.Jar should do). Click on OK

    8) If everything has gone ok, you should have a new ELAN.jar file, which you should place within your project assets folder -within the Plugins/Android subfolder.


    If you encounter any issues or find the process difficult, contact me on my email and I can help you out further.

    Cheers
     
  16. jdg123

    jdg123

    Joined:
    Nov 5, 2013
    Posts:
    3
    Hello CarlosFM,

    When my project was in 4.1.5, my game crashed on some devices when tapping on the notification. This is the same problem xsodus is experiencing (I compared both monitor logs to validate). I had the same problem in your demo project too.

    Then I updgraded my game project to 4.2.2, just in case the problem is with unity. The crashes stopped, but I have a problem that is similar to inbursts' except I don't use a custom activity instead of UnityPlayerActivity, so your solution won't help me. My guess is we are losing and/or recreating the GLContext in some way, but I have no clue as to what would cause this behavior.

    Any Guesses? Thanks.
     
  17. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi jdg123,

    It's good to know that the arbitrary crashing seems to be a Unity thing -that is solved in 4.2.2.

    As per the materials bug when you re-enter the app, it's truly puzzling! I do not even know why when you have a custom activity it shows that behaviour -but luckily it can be solved. Now if you are saying you don't have any custom activity extending the UnityPlayerActivity, then that's confusing!

    I'll see if I can find any information about it.
     
  18. jdg123

    jdg123

    Joined:
    Nov 5, 2013
    Posts:
    3
    Hello CarlosFM,

    While upgrading to 4.2.2 fixes the crash, I think both of my problems might be related.
    for example:

    4.1.5 :couldn't create GLContext -> crash (in Unity 4.2.0 changelogs : Android: Fixed crash on GL context recreate.)
    4.2.2 :could create GLContext, but with some issues -> graphic bugs

    in other words I think the cause of the issue could be the same as the cause of the crash, which could be anything that causes a problem with recreating the GLContext
     
  19. jdg123

    jdg123

    Joined:
    Nov 5, 2013
    Posts:
    3
    Hello CarlosFM,

    The problem I had happened because we were using UnityPlayerProxyActivity in our project, which has responsibility for creating either an activity or a nativeActivity. Calling an intent for the proxyActivity isnt a good idea, so here's what I had to do:

    Code (csharp):
    1. int intentFlag = 0;
    2.     Class<?> c = null;
    3.     try {
    4.         if(UnityPlayer.currentActivity != null)
    5.         {
    6.             intentFlag |= Intent.FLAG_ACTIVITY_REORDER_TO_FRONT;
    7.             c = UnityPlayer.currentActivity.getClass();
    8.         }
    9.         else
    10.         {
    11.             c = Class.forName("com.unity3d.player.UnityPlayerProxyActivity");
    12.         }
    if unityPlayer exists, call activity or NativeActivity depending on which one was started, and with FLAG_ACTIVITY_REORDER_TO_FRONT

    else restart UnityPlayerProxyActivity.

    I also had to set both the Activity and the NativeActivity to singleTop in the manifest.
     
  20. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Oh, great jdg123!

    I'm glad you finally cracked it. Good you posted here for someone having similar issues.

    Cheers
     
    Last edited: Dec 10, 2013
  21. johnnelsonrose

    johnnelsonrose

    Joined:
    Nov 30, 2013
    Posts:
    1
    Hi Carlos,

    Thanks for all your help in the forum.

    I wanted to make sure that ELANManager.CancelNotification() works across app sessions. I'm saving the notification ID from a SendNotification() to a file, force-stopping and restarting the app, and then calling CancelNotification on that same ID.

    This is the beginning of the error I immediately get:
    E/dalvikvm(22854): JNI ERROR (app bug): accessed stale local reference 0x1d200001 (index 0 in a table of size 0)
    E/dalvikvm(22854): VM aborting
    F/libc (22854): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 22966 (GC_start_routin)

    I don't get any problems if I don't shut down the app, so I was wondering if it's supported behavior. Thanks!

    John


    EDIT: I got this problem to go away after delaying it a bit in the sequencing. I might have been cancelling the notification too early, but it seems to work now. Thanks.
     
    Last edited: Dec 2, 2013
  22. Tongie

    Tongie

    Joined:
    Sep 19, 2012
    Posts:
    90
    Hi I cant get it to work on android, do we need an activity on AndroidManifest.xml or just the service will do?

    Code (csharp):
    1.     <!-- ECPN -->
    2.     <activity
    3.       android:name="com.swagsoft.rsaf.GCMJava"
    4.       android:label="@string/app_name">
    5.     </activity>
    6.    
    7.     <!-- GCM java(ECPN) -->
    8.     <service android:enabled="true" android:name="com.swagsoft.rsaf.GCMJava" />
    9.     <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
    10.       <intent-filter>
    11.         <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    12.         <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
    13.         <category android:name="com.swagsoft.rsaf" />
    14.       </intent-filter>
    15.     </receiver>
    16.     <service android:name="com.swagsoft.rsaf.GCMIntentService" />
     
  23. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    I believe you meant to post in the ECPN forum :)

    Since an early version, only the service is needed -notsure how you ended up with both. phase refer to the guide and the example manifest for reference.

    Cheers
     
  24. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    308
    Hello Carlos, I'm using ELAN for my Android project and everything seems to work pretty well (including sound and vibration), but there is a major problem: quite often, clicking on the notification will either pop up a black screen or do nothing at all.
    Do you know if it is an ELAN-related bug? Thanks for the help. :)
     
  25. b_ill

    b_ill

    Joined:
    Aug 13, 2012
    Posts:
    5
    I'm having issues getting even the demo to work properly -- when selecting the notification from the tray to launch the application, it just hangs on a black screen. I checked the manifest in the Temp/Staging folder to make sure that 1) the package name is set appropriately to match my player settings, and 2) it includes the ELAN service/receiver lines.

    This only appears to be an issue when the application is already resident in memory -- if I kill the process before opening the notification, the app will start as normal.

    Unity 4.3.1f1, Nexus 7 (2013 edition), Android 4.4.2
     
    Last edited: Jan 31, 2014
  26. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi DanjelRicci / b_ill,

    Could you please send me a copy of the logcat produced around the error/crash? That would help me to pinpoint the issue.

    My email address is: carlos.fernandez.musoles(at)gmail(dot)com

    Cheers
     
  27. b_ill

    b_ill

    Joined:
    Aug 13, 2012
    Posts:
    5
    I'll send something over within the next few days.
     
  28. nimshory

    nimshory

    Joined:
    Jan 19, 2014
    Posts:
    2
    Hello Carlos,
    First of all, thanks for this nice plugin and for the support you are providing for it.
    I am also experiencing an app crash when tapping on the notification.
    If the app is closed, a tap on the notification opens it with no problem but if the app is in the background it will just crash.
    I am using Facebook's official plugin and ELAN only and i did not changed anything in the java project.
    Any thoughts on this issue?

    Thanks.
     
  29. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi nimshory,

    Could you please run the app and send me the logcat around the moment of crashing? It would also help to see if any of your activities has the MAIN and LAUNCHER tags on your manifest.

    Please send the information to my support email: carlos.fernandez.musoles (at) gmail (dot) com

    Thanks
     
  30. nimshory

    nimshory

    Joined:
    Jan 19, 2014
    Posts:
    2
    Thank you for your quick reply Carlos.
    I have sent you an email with the files you have requested.
     
  31. KamiKaze425

    KamiKaze425

    Joined:
    Nov 20, 2012
    Posts:
    207
    Not sure if I missed this, but is there a way to clear all local notifications? Say a user receives a local notification but they enter the app normally rather than clicking the notification. I would like to delete the notification anyways.
    So it's not quite a cancel since they already received it.
     
  32. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi KamiKaze425,

    That's an excellent point, we'll make sure it's included on the next release -coming very soon!
     
  33. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi CarlosFM,

    How would I set a repeating local notification daily, weekly or yearly? In the notificationservices I can use CalendarUnit.day, CalendarUnit.week or CalendarUnity.month. I checked the PDF but couldn't exactly find an option for this :(

    I'm now doing it like this:

    Code (csharp):
    1.  
    2. public void SetPushNotification(CalendarUnit interval, string title, string message)
    3. {
    4.     #if UNITY_ANDROID
    5.     if(interval == CalendarUnit.Day)
    6.     {
    7.         ELANManager.ScheduleRepeatingNotification(title, message, 86400L, long.MaxValue);
    8.     }
    9.     else if(interval == CalendarUnit.Week)
    10.     {
    11.         ELANManager.ScheduleRepeatingNotification(title, message, 604800L, long.MaxValue);
    12.     }
    13.     else if(interval == CalendarUnit.Month)
    14.     {
    15.         ELANManager.ScheduleRepeatingNotification(title, message, 2678400L, long.MaxValue);
    16.     }
    17.     #endif
    18.    
    19.     #if UNITY_IOS
    20.     LocalNotification notif = new LocalNotification();
    21.     notif.alertAction = title;
    22.     notif.alertBody = message;
    23.     notif.repeatCalendar = CalendarIdentifier.GregorianCalendar;
    24.     notif.repeatInterval = interval;
    25.     notif.applicationIconBadgeNumber = NotificationServices.localNotificationCount + 1;
    26.     notif.hasAction = true;
    27.  
    28.     //Schedule local notification
    29.     NotificationServices.ScheduleLocalNotification(notif);
    30.     #endif
    31. }
    32.  
    Also, is there a way to keep track of local notifications, this would be really nice if I wanted to setup repeating local notifcations!
     
  34. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi Tripwire,

    Thanks an excellent suggestion! I'll include the hack myself so you can specify lengths of time in CalendarUnits :) As per how to set them up, note that in the guide there is an explanation about the parameters for ScheduleRepeatingNotifications(..):

    Code (csharp):
    1. ELANManager.ScheduleRepeatingNotification(string title, string message, int delay, int repeat). Similar to SendNotification(..) above, but with an extra parameter that makes the notification show up repeatedly:
    2. - repeat: time in between repetitions (the notification will be fired every ‘repeat’ seconds). It must be an integer.
    Note that the way you are using it, you'll actually be setting a notification to appear the first time in a month / Week / Day, but after that repeat every long.MaxValue seconds! Surely that's not what you want ;P

    As per keeping track of notifications, a way to do it is to store their IDs in your PlayerPrefs, but that's up to your app really.
     
  35. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    BUG FIX

    Hi all,

    After many debugging, logging, and testing, we've managed to solve the infamous bug for Unity 4.3 and above projects, whereby tapping on notifications created with the plugin when the app is in the background would show a black screen (as opposed to opening your app).

    Note this only seemed to affect Unity 4.3 and above projects, but you are more than welcome to apply these changes on any Unity project -it won't break what you have.

    I'll push an update soon -together with many new features!- but for those of you who can't wait, here is how to solve it:

    1) Go to your manifest and remove all activity declarations for UnityPlayerActivity, UnityPlayerProxyActivity and UnityPlayerNativeActivity.

    2) Add the following activity:

    Code (csharp):
    1.  
    2. <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name"
    3.             android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    4.     <intent-filter>
    5.         <action android:name="android.intent.action.MAIN" />
    6.         <category android:name="android.intent.category.LAUNCHER" />
    7.     </intent-filter>
    8.     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    9. </activity>
    10.  
    Please give me a shout if you are still struggling with this. My support address is: carlos.fernandez.musoles (at) gmail (dot) com

    Cheers!
     
    Last edited: Mar 5, 2014
  36. HenrikC

    HenrikC

    Joined:
    Jul 3, 2013
    Posts:
    6
    Hi Carlos,
    I was just wondering about the android:installLocation property in the AndroidManifest.xml provided with ELAN:
    Code (csharp):
    1. <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal"
    The preferExternal will try to install the app on external SD card, if possible. But this Android dev page recommends NOT to do that if the app is using Services or Alarm Services.

    On the other hand, the same article recommends games and other large apps to be installed on SD card. Which setting do you think would be better, or should it be up to the developer? Cheers!

    -Henrik
     
  37. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi HenrikC,

    Very good point! Certainly I left that tag in the manifest without much thinking, so it is up to each developer to decide where they want their app installed; it is not a requirement of the plugin either way.

    But as you mentioned, google recommends not to install services or alarm-based apps in the external storage for one reason and one alone: if your user plugs their device to a computer and switch the phone to USB storage mode, all apps running on the external SD will be killed, which means any future alarms won't occur, hence cancelling your future notifications.

    This needs to be considered by you as the developer, depending on your app and whether the risk of missing notifications is high enough. As a general recommendation I would remove the tag altogether (and hence that will I do on the next update).

    Thanks for your comment!
     
  38. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    Hey Carlos,

    We just bought your plugin today and we have a few questions/suggestions:
    • We've attached a 72x72 PNG as the icon and it looks very compressed in the notification bar, is there someway to improve this?
    • The notifications don't seems to make any sounds/vibrations/light up the screen when the device is locked - is there a way to achieve this?
    • Are notifications removed when you restart the device?
    • We have read on the Prime31 site (which we use plenty of their plugins) that there is a problem with having more than 1 plugin use the "res" directotry:
      Note: there is a major issue with regard to any Android plugins that have external assets stored in the "res" folder. Currently, only 1 plugin with external assets can be deployed in an application. This is a limitation with regard to how assets are handled with Android as a whole. We are always on the looking for a solution that does not require recompiling Java code directly and have not yet found one.
      Is it somehow possible to maybe use the game's icon set in Unity?
    • I have taken the liberty of improving the ELANManager file and I've attached it here, I hope that's OK.

    Some changes made to ELANManager:
    • Cleaned up code
    • Removed unnecassary list duplication in cancel all notifications (causes needless extra GC)
    • Moved all "magical strings" to consts
    • ELANManager now a static class
    • Removed duplicated initialization of the class (now done in static constructor once)
    • Regarding the ID - I'm not sure how it's handled internally, but with the "random" logic you've chosen you can theoretically hit duplicate IDs - if it's only used for the current session you should simply using an incrementing static integer
    • Added a new SendNotification which receives a TimeSpan as a delay (much simpler to use)

    If you can add the requests I've asked for I will be more than happy to greatly improve your plugin further (implement a decent notification tracking to prevent the user from being spammed to death, etc).

    Thanks,
    Ron
     
    Last edited: Mar 25, 2014
  39. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi rejwan,

    You certainly are enthusiastic, I love that! Thanks for all the suggestions and queries, we are always working to improve our plugins.

    Have you tried with a higher resolution icon? The tests we run show the icon perfectly visible

    Yes, you can. It requires you to recompile the ELAN.jar package -I've included the source code inside it so you can adapt the plugin to your every need! Just modify the code within TimedAlarm.java, method onReceive. There you can add vibrations and customise your notification a little bit more. We are working to include an option within Unity to offer this out-of-the-box.

    Unfortunately yes, they are removed at the moment.


    We are working on solving this for the next update, coming very soon!

    Thank you again for your suggestions, we take them on board and will include some in our next update.

    Cheers
     
  40. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    We've tried using larger icons than 72x72 but they came out cropped.
    The 72x72 looks like this:
    $ic_launcher.png

    And you can see it's pixelated here:
    $Screenshot_2014-03-24-13-03-46.png

    Unfortunately the source code isn't included in ELAN package downloaded from the asset store.
    Attached is a screenshot of the package contents:
    $Capture.JPG
     
    Last edited: Mar 24, 2014
  41. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @rejwan: The ELAN.jar file does contain all the source code. As with any jar file, it's a zip file in disguise, so if you unzip the ELAN.jar you will see the source code included there.

    As per the icon, I'll double check but I can't really see much difference in the attachments -mind you I need glasses to see the front of my hand :)
     
  42. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    Got it thanks :)
    I've never built a plugin for Android, do you have a quick guide on how to recompile it?
     
  43. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Yeah, no problems. Here is a rough step by step guide to recompile the package:

    1- Unzip the ELAN.jar file. You may need to create a copy and rename the extension to .zip before doing so

    2- If you use Dr. Java IDE (a very simple java IDE) the folder generated is a project, so all you have to do is open the .drjava file. If you want to use any other IDE that's fine, just import all the classes under the folder structure com/CFM/ELAN

    3- You may need to import two required libraries: classes.jar (included in the ELAN.jar package) and android.jar, which is present in every android SDK installation.

    4- Open and edit any of the java files, and once done, save and compile. Export the project as a Jar file (if using Dr. Java, this is as simple as going through the menus to Project > Create Jar File From Project. Specify that you want Jar classes only and also the name of the .jar package you want to create (you can leave it as ELAN.jar again).

    5 -Copy the new jar package to your assets folder, under Plugins/Android. Remember to remove the original one or you will have conflicts upon building.

    Hope that helps!
     
  44. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    Worked like a charm, now we only need to fix the icon.

    Also, if I register a notification (ELANManager.SendNotification(...)), close the game and reopen it and call "ELANManager.CancelAllNotifications();", will it be cancelled?
     
  45. rejwan1

    rejwan1

    Joined:
    Jul 3, 2012
    Posts:
    40
    Also, when we added ELAN to an existing project with an Android manifest, it works - but clicking on the notification didn't open up our game :(

    Any idea how to fix this?
     
  46. blastproofgames

    blastproofgames

    Joined:
    Apr 3, 2014
    Posts:
    18
    I have the exact same problem here.


     
  47. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    @rejwan1 and @mironal3x

    Apologies for the delayed answer, but for some reason I didn't get a notification of your messages.

    If the demo scene works with you but when you integrate it in your projects you are not seeing the expected results, I would guess it's a problem with your AndroidManifest file.

    Could you please send me a copy of your manifest to my email so I can take a look at it? My address is carlos.fernandez.musoles (at) gmail (dot) com

    Cheers
     
  48. ricardo81

    ricardo81

    Joined:
    Apr 25, 2014
    Posts:
    2
    Hello, I passed something similar. When I export my app since unity to eclipse have problems. The notification appears with success but when I press the icon does not return to the application. Have an idea of how I can make it work well? I have added the necessary lines in the manifest and I've also imported the JAR elan my eclipse project. The problem persists. I need to make that pressing the notification in the status bar back to the game. Can you help me?
     
  49. CarlosFM

    CarlosFM

    Joined:
    Jun 8, 2013
    Posts:
    240
    Hi ricardo,

    Any chance you can send me the logcat of your app when you tap on the notification? Also could you include the android manifest? You mentioned you modified the java classes, so if you could explain how, that-ll be great.

    Please send everything to carlos.fernandez.musoles (at) gmail (dot) com
     
  50. ricardo81

    ricardo81

    Joined:
    Apr 25, 2014
    Posts:
    2

    Hello again. As you said to me by mail, the problem is that my MAIN activity is "com.Android.AndroidProxyActivity" not "com.unity3d.player.UnityPlayerProxyActivity". By changing one activity for another, the notification works.

    The question is: Is posible change the ELAN.jar to work with my MAIN activity?
    In DrJava program. I have tried to modify the jar as you explained in this forum. I tried to modify the timedalarm.java but I could not solve my problem. My logcat is still the one I sent by mail.


    best regards