socialize / socialize-sdk-android

Socialize SDK for Android. An Android social sharing SDK for native apps.
www.getsocialize.com
Apache License 2.0
147 stars 57 forks source link

Notifications need WAKE_LOCK #13

Closed harpbola closed 12 years ago

harpbola commented 12 years ago

Tried out notification and got following 01-14 14:35:19.706: W/System.err(733): java.lang.SecurityException: Neither user 10040 nor current process has android.permission.WAKE_LOCK. 01-14 14:35:19.716: W/System.err(733): at android.os.Parcel.readException(Parcel.java:1322) 01-14 14:35:19.716: W/System.err(733): at android.os.Parcel.readException(Parcel.java:1276) 01-14 14:35:19.716: W/System.err(733): at android.os.IPowerManager$Stub$Proxy.acquireWakeLock(IPowerManager.java:277) 01-14 14:35:19.716: W/System.err(733): at android.os.PowerManager$WakeLock.acquire(PowerManager.java:253) 01-14 14:35:19.726: W/System.err(733): at com.socialize.notifications.BaseC2DMReceiver.acquireWaitLock(BaseC2DMReceiver.java:119) 01-14 14:35:19.726: W/System.err(733): at com.socialize.notifications.SocializeBroadcastReceiver.onBroadcastReceive(SocializeBroadcastReceiver.java:47) 01-14 14:35:19.726: W/System.err(733): at com.socialize.notifications.SocializeBroadcastReceiver.onReceive(SocializeBroadcastReceiver.java:41) 01-14 14:35:19.726: W/System.err(733): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1769) 01-14 14:35:19.726: W/System.err(733): at android.app.ActivityThread.access$2400(ActivityThread.java:117) 01-14 14:35:19.726: W/System.err(733): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:978) 01-14 14:35:19.726: W/System.err(733): at android.os.Handler.dispatchMessage(Handler.java:99) 01-14 14:35:19.726: W/System.err(733): at android.os.Looper.loop(Looper.java:123) 01-14 14:35:19.726: W/System.err(733): at android.app.ActivityThread.main(ActivityThread.java:3647) 01-14 14:35:19.726: W/System.err(733): at java.lang.reflect.Method.invokeNative(Native Method) 01-14 14:35:19.726: W/System.err(733): at java.lang.reflect.Method.invoke(Method.java:507) 01-14 14:35:19.726: W/System.err(733): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 01-14 14:35:19.726: W/System.err(733): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 01-14 14:35:19.726: W/System.err(733): at dalvik.system.NativeStart.main(Native Method) 01-14 14:35:20.026: D/dalvikvm(733): GC_CONCURRENT freed 473K, 48% free 3757K/7175K, external 1135K/1602K, paused 4ms+13ms 01-14 14:35:20.166: W/Socialize(733): NotificationIdGenerator: Class [com.socialize.notifications.NotificationIdGenerator] is deprecated. It will be created but should be reviewed for continued use 01-14 14:35:20.196: W/Socialize(733): BeanBuilder: No public method found called [setNotificationIdGenerator] of class [com.socialize.notifications.SocializeC2DMCallback] with args [com.socialize.notifications.NotificationIdGenerator] when setting properties on bean [notificationCallback] 01-14 14:35:20.246: D/Socialize(733): Received notification [{"activity_id": 316172, "text": "Text #2", "entity": "GetSocialize", "user": "User55815293", "notification_type": "new_comments", "activity_type": "comment"}]

I added to manifest

and did not get the error. Here is what I now get:

01-14 14:38:13.096: W/Socialize(819): NotificationIdGenerator: Class [com.socialize.notifications.NotificationIdGenerator] is deprecated. It will be created but should be reviewed for continued use 01-14 14:38:13.146: W/Socialize(819): BeanBuilder: No public method found called [setNotificationIdGenerator] of class [com.socialize.notifications.SocializeC2DMCallback] with args [com.socialize.notifications.NotificationIdGenerator] when setting properties on bean [notificationCallback] 01-14 14:38:13.316: D/Socialize(819): Received notification [{"activity_id": 316177, "text": "Text #2", "entity": "GetSocialize", "user": "User55815293", "notification_type": "new_comments", "activity_type": "comment"}]