Implement simple invitation mechanism

This commit is contained in:
nielsandriesse 2020-11-02 14:46:08 +11:00
parent bd109a8964
commit f5db53e874
1 changed files with 9 additions and 1 deletions

View File

@ -182,7 +182,9 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate {
getSeparator(),
getSettingButton(withTitle: NSLocalizedString("vc_settings_privacy_button_title", comment: ""), color: Colors.text, action: #selector(showPrivacySettings)),
getSeparator(),
getSettingButton(withTitle: NSLocalizedString("vc_settings_notifications_button_title", comment: ""), color: Colors.text, action: #selector(showNotificationSettings))
getSettingButton(withTitle: NSLocalizedString("vc_settings_notifications_button_title", comment: ""), color: Colors.text, action: #selector(showNotificationSettings)),
getSeparator(),
getSettingButton(withTitle: "Invite", color: Colors.text, action: #selector(sendInvitation))
]
let isMasterDevice = UserDefaults.standard.isMasterDevice
if isMasterDevice {
@ -399,6 +401,12 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate {
let deviceLinksVC = DeviceLinksVC()
navigationController!.pushViewController(deviceLinksVC, animated: true)
}
@objc private func sendInvitation() {
let invitation = "Hey, I've been using Session to chat with complete privacy and security. Come join me! Download it at https://getsession.org/. My Session ID is \(userHexEncodedPublicKey)!"
let shareVC = UIActivityViewController(activityItems: [ invitation ], applicationActivities: nil)
navigationController!.present(shareVC, animated: true, completion: nil)
}
@objc private func showSeed() {
let seedModal = SeedModal()