notification

android notification launches same activity twice

匿名 (未验证) 提交于 2019-12-03 02:26:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I click the notification on the status bar it launches an activity but the behavior is strange. If my app is in foreground and I click the notification the notification intent is fired once. If my app is in background then the notification intent is fired twice. If I exit the app (ie all activities have been popped by hitting the back button) then notification intent is fired once. Can anyone explain this behaviour. The code snippet is as follows: _notification = new Notification(icon_id, "Ticker Text", System.currentTimeMillis());

Android - Build a notification, TaskStackBuilder.addParentStack not working

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to launch an activity from a notification like the Android docs explain, but when I open the notification and then press the back button, the HomeActivity (parent) doesn't open, instead the application closes. What am I doing wrong? Intent resultIntent = new Intent(context, MatchActivity.class);; resultIntent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); // Adds the back stack for the Intent (but not the Intent itself) stackBuilder.addParentStack(MainActivity.class)

push silent notification through GCM to Android/IOS

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm seeking to send an state update to an application, which can (or not), be silent. For example, if the user gets a new message from one of their friends I want to send such message and be able to display an alert with sound. But in the silent case, I want the user not to notice such notification. it must be gathered by the application; for example if my user has two devices and he changes his name in one of them, I want to send the other device (which is sleeping) a silent name update, that should trigger a change (be dispatched to the

Android FCM notification issue

匿名 (未验证) 提交于 2019-12-03 02:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am struggling with FCM notifications on Android. The issue is only when the app is closed and not running. I am trying to achieve no click activity I don't want the app to open and I do not want the message to disappear. It works perfectly when the app is open and running. When the app is not open I still get the notification but it is not in multi-line so I can only see the beginning of the notification. Then clicking on the notification makes it disappear. I have spent hours trying to find a solution that works. Here is the code i have

Play notification audio by URI

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have URI of the notification sound, like content://media/internal/audio/media/122 , but SoundPool doesn't work with URIs, it works with only apk resources of file paths. Is there a way to get media file path from URI? I tried Uri.getPath() , which returns /internal/audio/media/122 , but this isn't valid file path, and of course SoundPool doesn't work with such patch. Actually the real path to the notification is /system/media/audio/notifications/allegro.ogg , and I see no way to get it from URI like content://media/internal/audio/media/122

Push notification - Caused by: java.io.IOException: toDerInputStream rejects tag type 45

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I got this error when my server try to push a notification to a specific device based on device token and ck.pem (combination between .pem file, cert and key). Caused by: java.io.IOException: toDerInputStream rejects tag type 45 This is full error message appear in my eclipse console. initial starting push notification sending 2014/03/20 14:28:00:252 INFO net.penril.notification.Initializer: ====Start Push Notification Sending==== SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger

Azure Notification Hub: Why is NotificationOutcome NotificationId Property Empty?

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using a Standard Notification Hub, I want to view telemetry for a specific message using the returned NotificationId and either this rest API: https://msdn.microsoft.com/en-us/library/azure/mt608135.aspx or the NotificationHubClient GetNotificationOutcomeDetailsAsync method: https://msdn.microsoft.com/en-us/library/microsoft.azure.notificationhubs.notificationhubclient.getnotificationoutcomedetailsasync.aspx Either way, I need the Notification Message Id that is supposed to be returned from the hub when sending the message. I am sending the

android - Bad notification posted - Couldn't expand RemoteViews for: StatusBarNotification

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to post a notification with custom view in the notification area from an IntentService, and getting the 'Couldn't expant RemoteView' error. Here's what I am doing in onCreate(): mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); icon = R.drawable.icon; tickerText = "data upload in progress"; contentView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.notiflayout); contentView.setImageViewResource(R.id.image, R.drawable.icon); contentView.setTextViewText(R.id.text,

Click on the Notification programmatically

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I trying click on the notification after receiving it. I'm able to drag the notification drawer using the Accessibility service. For clicking the notification I'm using accessibilityEvent.getSource() and accessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK); My code: public class MyAccessibilityService extends AccessibilityService { /** * On receiving the AccessibilityEvent performs the Actions * * @param event */ @Override public void onAccessibilityEvent ( AccessibilityEvent event ) { Log . i ( TAG , "Get the

Android BLE API: GATT Notification not received

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Device used for testing: Nexus 4, Android 4.3 Connection is working fine but the onCharacteristicChanged Method of my callback is never called. However I am registering for notifications using setCharacteristicNotification(char, true) inside onServicesDiscovered and that function even returns true. Device log (there are actually no messages at all when notifications should appear / are sent via the Bluetooth device): 07-28 18:15:06.936 16777-16809/de.ffuf.leica.sketch D/BluetoothGatt: setCharacteristicNotification() - uuid: 3ab10101-f831