Android 从应用程序到特定用户的通知
Android Notification from an app to only specific user
我想构建一个 Android 应用程序来跟踪 users.So 的出勤情况,每个用户都有一个帐户,其中包含用户名和密码,并且会有一个管理员可以查看出勤详细信息database.So 每天的每个用户,当用户登录他们的帐户并输入当天的考勤时,如果用户将自己标记为当天缺席,则需要发送通知 "Only to the Manager"通过应用程序,用户将缺席 day.And 当用户将自己标记为 Absent.Can 时,服务器将发出通知 任何人请告诉我如何继续?我是 Android.
如果用户将自己标记为不缺席并且他甚至不在学校怎么办?
你可以查看 Firebase Notifications
Firebase is a mobile and web application platform with tools and infrastructure designed to help developers build high-quality apps. Firebase is made up of complementary features that developers can mix-and-match to fit their needs.
编辑
With Firebase Notifications, you can target notifications to a single, specific device. You'll need access to the registration token for the app instance on that device, in order to provide the token when composing and sending the notification in the Notifications console.
请检查this,你会得到它!
使用SharedPreferences
当您登录商店时,是否是经理登录:
private final String KEY_PREF_NAME = "UserInfoSettings",
KEY_IS_MANAGER = "KEY_IS_MANAGER";
private SharedPreferences mPref = getSharedPreferences(KEY_PREF_NAME, Context.MODE_PRIVATE);
mPref.edit()
.putBoolean(KEY_IS_MANAGER, value)
.commit();
值=真或假
当您收到通知时,检查登录的人是否是经理:
if(mPref.getBoolean(KEY_IS_MANAGER, false)){
//TODO show notification
}
注销时清除首选项:
mPref.edit().clear().commit();
我想构建一个 Android 应用程序来跟踪 users.So 的出勤情况,每个用户都有一个帐户,其中包含用户名和密码,并且会有一个管理员可以查看出勤详细信息database.So 每天的每个用户,当用户登录他们的帐户并输入当天的考勤时,如果用户将自己标记为当天缺席,则需要发送通知 "Only to the Manager"通过应用程序,用户将缺席 day.And 当用户将自己标记为 Absent.Can 时,服务器将发出通知 任何人请告诉我如何继续?我是 Android.
如果用户将自己标记为不缺席并且他甚至不在学校怎么办?
你可以查看 Firebase Notifications
Firebase is a mobile and web application platform with tools and infrastructure designed to help developers build high-quality apps. Firebase is made up of complementary features that developers can mix-and-match to fit their needs.
编辑
With Firebase Notifications, you can target notifications to a single, specific device. You'll need access to the registration token for the app instance on that device, in order to provide the token when composing and sending the notification in the Notifications console.
请检查this,你会得到它!
使用SharedPreferences
当您登录商店时,是否是经理登录:
private final String KEY_PREF_NAME = "UserInfoSettings",
KEY_IS_MANAGER = "KEY_IS_MANAGER";
private SharedPreferences mPref = getSharedPreferences(KEY_PREF_NAME, Context.MODE_PRIVATE);
mPref.edit()
.putBoolean(KEY_IS_MANAGER, value)
.commit();
值=真或假
当您收到通知时,检查登录的人是否是经理:
if(mPref.getBoolean(KEY_IS_MANAGER, false)){
//TODO show notification
}
注销时清除首选项:
mPref.edit().clear().commit();