#If B4J
Public Sub Initialize (Target As Object, EventName As String, ClientId As String, scope As String, ClientSecret As String, DataFolder As String)
#Else
Public Sub Initialize (Target As Object, EventName As String, ClientId As String, Scope As String)
#End If
evModule = Target
evName = EventName
mClientId = ClientId
mScope = Scope
#if B4A
packageName = Application.PackageName
TokenFolder = File.DirInternal
#Else If B4i
TokenFolder = File.DirLibrary
packageName = GetPackageName
#Else If B4J
TokenFolder = DataFolder
mClientSecret = ClientSecret
#End If
If File.Exists(TokenFolder, TokenFile) Then
Dim raf As RandomAccessFile
raf.Initialize(TokenFolder, TokenFile, True)
ti = raf.ReadB4XObject(raf.CurrentPosition)
raf.Close
End If
End Sub