如果我在Google Play上安装了应用,我会注意到它会告诉我应用所需的权限。一旦它在应用程序中执行它也会提示我。这一切都很好。
我想阅读Google或Apple帐户的电子邮件,而不会提示最终用户收到电子邮件。
我不想将电子邮件用作身份验证令牌,而是预先填写“订阅新闻信”字段。然后,用户可以打开或关闭(或选择添加其他电子邮件)。
答案 0 :(得分:9)
如果我的问题正确, 您需要获取当前登录用户的主电子邮件地址,该地址可用于预先填写某种表格(例如,注册表单)
适用于Android
尝试以下反应原生包装库react-native-account-manager
使用上述链接自述文件中的说明进行设置后,请使用以下代码检索已登录的Google帐户列表。
请注意,如果没有与设备相关联的Google帐户,则可能会产生一个空列表
from win32api import GetKeyState
import tkinter.ttk
import tkinter
class MainApplication:
"""Class that creates the widgets and window."""
def __init__(self, master):
"""Method that creates the class constructor."""
self.master = master
self.var = tkinter.IntVar(value=0)
self.left_MB_entry = self.Entry(self.var)
self.left_MB_entry.grid()
def Entry(self, text_var, justify="center"):
"""Method that defines a default entry field."""
entry = tkinter.ttk.Entry(self.master, textvariable=text_var, justify=justify)
return entry
class MouseCounter:
"""Class that counts mouse button clicks."""
def __init__(self, variable):
"""Method that creates the class constructor."""
self.LEFT_MB = 0x01 # Virtual-key code from Microsoft for LEFT MButton
self.Old_State_LEFT_MB = GetKeyState(self.LEFT_MB) # LEFT MButton Down = -127 or -128, MButton Up = 0 or 1
self.LEFT_MB_Counter = 0 # Initialize to 0
self.variable = variable
self.variable.set(self.LEFT_MB_Counter)
def count(self):
# Following block of code monitors LEFT MButton
New_State_LEFT_MB = GetKeyState(self.LEFT_MB)
if New_State_LEFT_MB != self.Old_State_LEFT_MB: # Button state changed
self.Old_State_LEFT_MB = New_State_LEFT_MB
print(New_State_LEFT_MB)
if New_State_LEFT_MB < 0:
self.LEFT_MB_Counter += 1
self.variable.set(self.LEFT_MB_Counter)
print("Count:", self.LEFT_MB_Counter)
print('Left Button Pressed')
else:
print('Left Button Released')
root.after(1, self.count)
root = tkinter.Tk()
root.style = tkinter.ttk.Style()
# ('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative')
root.style.theme_use("clam")
APP = MainApplication(root) # Create object instance of the user interface
mouse_counter = MouseCounter(APP.var) # Create an instance outside of mainloop.
root.after(0, mouse_counter.count)
root.mainloop() # Display the user interface
适用于iOS
运气不好
Apple NOT 向应用开发者公开iPhone用户的详细信息,例如他们的电子邮件地址,密码或信用卡详细信息。
另一种方法是使用icloud令牌来创建用户。您可以使用following guide to do it
有关使用react-native使用react-native-icloud-user-token库
获取iCloud令牌的包装器奖励