i am having application in which i am showing notifications .The notifications are displayed properly when my app is in background but the problem is notification does not appear when the iphone screen is locked.Please help me in solving this problem.
This is a user preference that can be activated in the Notifications section of the Settings app. There is no way to control this from within your app.
Related
please is there a way to display or open a Flutter page when screen is locked in Flutter like how WhatsApp displays incoming call page when screen is locked? I used Wake up plugin but can't display the page on screen locked. Please I need a guide to do that. Thanks in advance.
What you are looking for is called a time sensitive notification with a full screen notification. What it does is that if the screen is locked it opens the activity linked to the pending intent used for full screen notification. When the phone is unlocked, it shows a heads up notification instead. You must have seen this behavior with all kinds of telephony apps and alarm apps.
A flutter app runs inside a single activity, so if you mark that as the activity to show during the locked state, the app will show. But it will act similar to how the app would when you launch it from start. Also the behavior is unpredictable as it is behind a wakelock. So a better option would be to move it to a separate activity and do the needful. Example of how to implement full screen notifications.
https://medium.com/android-news/full-screen-intent-notifications-android-85ea2f5b5dc1
I'm developing an app that works with sensitive information.
One of the requirements is that when a user puts the app in background the content that the app is currently displaying has to be hidden, so if another person navigate through the apps in background he can't see the last screen where the user was.
Any ideas on how to do that?
I tried to show an overlay when the app moves to AppLifecycleState.paused, but it doesn't work for me, the app prints a message if I want but it can't update the UI.
Edit
Shameless plug: i did a library for doing just that as I also needed it:
https://pub.dev/packages/secure_application
Answear
Build is not called after paused, at least on Android.
For Android I used a flutter_windowmanager package (modified to still be able to build on IOS):
https://github.com/neckaros/flutter_windowmanager
When my app need securing I add the flag secure:
FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE)
And my app is now a black screen in the app switcher.
You should still hide content your way for when the user get back to the app.
Otherwise you can go native:
https://medium.com/#mehmetf_71205/securing-flutter-apps-ada13e806a69
I have implemented push notifications for my iPhone application. Everything is working fine. Only problem is when I receive notification during app is in background the iOS notification shows wrong icon for the notification. Like if notification came for App A it shows the icon of App B in notification badge.
What can cause this? Is it certificates problem or what? Any idea?
if you have some images name like "icon.png", that will be displayed in push notification
Few more thing can cause this issue,
If you have used same push profile for two different project. Than also this will happen.
Moreover if you have specified Small-Icon.png in you .plist file than that would be used as a push notification icon in notification screen.
Please make sure this things in your projects.
I searched a lot and didn't find how to programmatically bring application to background so phone's home screen is shown. I don't want to terminate app, but just to programmatically make press on HOME button. Is there any way to do it?
No, unfortunately not. There is no public API that allows you to send a user back to the homescreen.
As shown in these questions:
iPhone - Sending the app to the background
Send App to Background process
Sending Application to background on iphone
Programmatically sending an iOS app to background
Brad Larson provides a detailed explanation to the answer of this question:
Suspend the application
Unfortunately, there is no background mode in iOS where the app can still run things while out of focus. Apple has designed the system to "pause" the application so state is preserved, but be careful the app can be terminated at any time.
You can do this by calling a private API but beware as said above Apple does not allow this on AppStore apps.
var x = UIApplication.SharedApplication;
x.PerformSelector (sel: new MonoTouch.ObjCRuntime.Selector ("suspend"), obj: x, delay: 5);
I was watching videos of iOS 5 Push Notification and I encountered that there are some differences in notifying User apart from Badges, Alert and Sound.
Please go through the Youtube video. Here the notification of Twitter comes on the status bar. So do we need to have programming in different way than our usual push notification?
Also when we drag that view downwards than directly navigated to new Message. So how can we achieve those new changes as being a Developer?
One More question is How can we achieve the scrolling in Notification Window....
Do you mean the banner that sits over the status bar? That's an option your users can choose in Settings. Just push an alert as usual, and if your users have selected to display alerts as banners, that's what they'll see.
No changes need to be done at developer end for viewing notifications in Notification bar or Banner. Though I have no idea how to enable scrolling in Notification Window.