You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Mac64bit/Accounts
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open()
#if TargetMacOS and Target64Bit then
AccountStore = new myACAccountStoreMBS
dim TwitterType as ACAccountTypeMBS = AccountStore.accountTypeWithAccountTypeIdentifier(ACAccountTypeMBS.ACAccountTypeIdentifierTwitter)
if TwitterType = nil then
break
else
// ask...
AccountStore.requestAccessToAccountsWithType TwitterType, nil
end if
// show what we have.
update
#else
MsgBox "This example is for Xojo 2015r3 with 64-bit app."
#endif
End EventHandler
Sub update()
list.DeleteAllRows
dim accounts() as ACAccountMBS = AccountStore.accounts
for each account as ACAccountMBS in accounts
List.AddRow account.identifier, account.accountType.accountTypeDescription, account.username, account.accountDescription
List.RowTag(List.LastIndex) = account
next
End Sub
Note "Plugins"
Property AccountStore As myACAccountStoreMBS
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class myACAccountStoreMBS Inherits ACAccountStoreMBS
EventHandler Sub Changed()
MainWindow.update
End EventHandler
EventHandler Sub requestAccessCompleted(granted as boolean, error as NSErrorMBS, accountType as ACAccountTypeMBS, tag as variant)
MainWindow.update
End EventHandler
End Class