├── _config.yml ├── source ├── deployedassets.txt ├── COCApiTest.res ├── HeaderFooter.ICO ├── urlManager.res ├── CloudStreaming.res ├── thundax.firebase.res ├── urlManagerMobile.res ├── thundax.testproject.res ├── Android │ └── Debug │ │ ├── classes.dex │ │ ├── CloudStreaming │ │ ├── assets │ │ │ └── deployinfo │ │ │ │ └── deployedassets.txt │ │ ├── classes │ │ │ └── classes.dex │ │ ├── library │ │ │ └── lib │ │ │ │ └── armeabi-v7a │ │ │ │ └── gdbserver │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-large │ │ │ │ └── splash_image.png │ │ │ ├── drawable-normal │ │ │ │ └── splash_image.png │ │ │ ├── drawable-small │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xlarge │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ └── styles.xml │ │ │ └── drawable │ │ │ │ └── splash_image_def.xml │ │ └── AndroidManifest.xml │ │ ├── FirebaseCloudMessaging │ │ ├── assets │ │ │ └── deployinfo │ │ │ │ └── deployedassets.txt │ │ ├── classes │ │ │ └── classes.dex │ │ ├── library │ │ │ └── lib │ │ │ │ └── armeabi-v7a │ │ │ │ └── gdbserver │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-large │ │ │ │ └── splash_image.png │ │ │ ├── drawable-normal │ │ │ │ └── splash_image.png │ │ │ ├── drawable-small │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xlarge │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ └── styles.xml │ │ │ └── drawable │ │ │ │ └── splash_image_def.xml │ │ └── AndroidManifest.xml │ │ ├── thundax.firebase │ │ ├── classes │ │ │ └── classes.dex │ │ ├── library │ │ │ └── lib │ │ │ │ └── armeabi-v7a │ │ │ │ └── gdbserver │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-large │ │ │ │ └── splash_image.png │ │ │ ├── drawable-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-small │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-normal │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xlarge │ │ │ │ └── splash_image.png │ │ │ ├── values │ │ │ │ └── styles.xml │ │ │ └── drawable │ │ │ │ └── splash_image_def.xml │ │ └── AndroidManifest.xml │ │ ├── urlManagerMobile │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-large │ │ │ │ └── splash_image.png │ │ │ ├── drawable-ldpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-small │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-normal │ │ │ │ └── splash_image.png │ │ │ ├── drawable-xlarge │ │ │ │ └── splash_image.png │ │ │ ├── values │ │ │ │ └── styles.xml │ │ │ └── drawable │ │ │ │ └── splash_image_def.xml │ │ └── AndroidManifest.xml │ │ ├── styles.xml │ │ ├── splash_image_def.xml │ │ ├── thundax.firebase.vsr │ │ └── AndroidManifest.xml ├── FirebaseCloudMessaging.res ├── HeaderFooterNavigation.ICO ├── HeaderFooterNavigation.res ├── thundax.baas.providers.res ├── ic_launcher │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-ldpi │ │ └── ic_launcher2.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── mipmap-xxxhdpi │ │ └── ic_launcher.png ├── COCApiTest.identcache ├── CloudStreaming.identcache ├── thundax.firebase.identcache ├── thundax.testproject.identcache ├── FirebaseCloudMessaging.identcache ├── COCApiTest.stat ├── HeaderFooterApplication.stat ├── thundax.baas.providers.stat ├── CloudStreaming.stat ├── HeaderFooterNavigation.stat ├── thundax.firebase.stat ├── urlManagerMobile.stat ├── thundax.testproject.stat ├── FirebaseCloudMessaging.stat ├── COCApiTest.dpr ├── CloudStreaming.dpr ├── ProjectBaaSDelphi.groupproj.local ├── urlManagerMobile.identcache ├── urlManagerMobile.dpr ├── thundax.testproject.dpr ├── urlManager.dpr ├── frmMain.vlb ├── thundax.baas.providers.identcache ├── frmUrlManagerMobile.LgXhdpiPh.fmx ├── frmUrlManagerMobile.LgXhdpiTb.fmx ├── COCApiTest.dproj.local ├── FirebaseCloudMessaging.dproj.local ├── thundax.testproject.dproj.local ├── frmMain.LgXhdpiPh.fmx ├── frmCoc.fmx ├── HeaderFooterFormwithNavigation.iPhone4in.fmx ├── thundax.baas.providers.dpk ├── urlManagerMobile.dproj.local ├── CloudStreaming.dproj.local ├── frmMain.iPhone4in.fmx ├── HeaderFooterFormwithNavigation.LgXhdpiPh.fmx ├── lib.parse.rest.pas ├── FirebaseCloudMessaging.dpr ├── AndroidManifest.template.xml ├── urlManager.dproj.local ├── frmCoc.pas ├── frmUrlManager.dfm ├── CloudMessaging.fmx ├── lib.urls.converter.pas ├── lib.coc.api.rest.pas ├── lib.urls.pas ├── frmUrlManager.pas ├── thundax.baas.providers.dproj.local ├── lib.runThread.pas ├── frmMain.fmx ├── lib.kinvey.rest.pas ├── ProjectBaaSDelphi.groupproj ├── uFormTest.dfm ├── lib.options.pas ├── lib.document.pas ├── frmUrlManagerMobile.pas ├── frmUrlManagerMobile.fmx ├── CloudMessaging.pas ├── lib.firebase.rest.pas ├── frmMain.pas ├── uFormTest.pas ├── urlManagerMobile.deployproj └── FirebaseCloudMessaging.deployproj ├── .gitignore ├── LICENSE └── README.md /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /source/deployedassets.txt: -------------------------------------------------------------------------------- 1 | .\assets\internal\libcrypto.so 2 | .\assets\internal\libssl.so 3 | -------------------------------------------------------------------------------- /source/COCApiTest.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/COCApiTest.res -------------------------------------------------------------------------------- /source/HeaderFooter.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/HeaderFooter.ICO -------------------------------------------------------------------------------- /source/urlManager.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/urlManager.res -------------------------------------------------------------------------------- /source/CloudStreaming.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/CloudStreaming.res -------------------------------------------------------------------------------- /source/thundax.firebase.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/thundax.firebase.res -------------------------------------------------------------------------------- /source/urlManagerMobile.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/urlManagerMobile.res -------------------------------------------------------------------------------- /source/thundax.testproject.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/thundax.testproject.res -------------------------------------------------------------------------------- /source/Android/Debug/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/classes.dex -------------------------------------------------------------------------------- /source/FirebaseCloudMessaging.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/FirebaseCloudMessaging.res -------------------------------------------------------------------------------- /source/HeaderFooterNavigation.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/HeaderFooterNavigation.ICO -------------------------------------------------------------------------------- /source/HeaderFooterNavigation.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/HeaderFooterNavigation.res -------------------------------------------------------------------------------- /source/thundax.baas.providers.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/thundax.baas.providers.res -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/assets/deployinfo/deployedassets.txt: -------------------------------------------------------------------------------- 1 | .\assets\internal\libcrypto.so 2 | .\assets\internal\libssl.so 3 | -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/assets/deployinfo/deployedassets.txt: -------------------------------------------------------------------------------- 1 | .\assets\internal\libcrypto.so 2 | .\assets\internal\libssl.so 3 | -------------------------------------------------------------------------------- /source/ic_launcher/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/ic_launcher/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/ic_launcher/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/ic_launcher/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/ic_launcher/res/mipmap-ldpi/ic_launcher2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/ic_launcher/res/mipmap-ldpi/ic_launcher2.png -------------------------------------------------------------------------------- /source/ic_launcher/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/ic_launcher/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/ic_launcher/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/ic_launcher/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/ic_launcher/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/ic_launcher/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/classes/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/classes/classes.dex -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/classes/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/classes/classes.dex -------------------------------------------------------------------------------- /source/COCApiTest.identcache: -------------------------------------------------------------------------------- 1 | CC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\COCApiTest.dpr?C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmCoc.pas -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/classes/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/classes/classes.dex -------------------------------------------------------------------------------- /source/CloudStreaming.identcache: -------------------------------------------------------------------------------- 1 | @C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmMain.pasGC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\CloudStreaming.dpr -------------------------------------------------------------------------------- /source/thundax.firebase.identcache: -------------------------------------------------------------------------------- 1 | IC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\thundax.firebase.dpr@C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmMain.pas -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/library/lib/armeabi-v7a/gdbserver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/library/lib/armeabi-v7a/gdbserver -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-large/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-large/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-normal/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-normal/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-small/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-small/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-xlarge/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-xlarge/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/CloudStreaming/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/library/lib/armeabi-v7a/gdbserver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/library/lib/armeabi-v7a/gdbserver -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-large/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-large/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-small/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-small/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-large/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-large/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-small/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-small/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/thundax.testproject.identcache: -------------------------------------------------------------------------------- 1 | LC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\thundax.testproject.dprBC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\uFormTest.pas -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-normal/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-normal/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable-xlarge/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/thundax.firebase/res/drawable-xlarge/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-normal/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-normal/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable-xlarge/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/urlManagerMobile/res/drawable-xlarge/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/library/lib/armeabi-v7a/gdbserver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/library/lib/armeabi-v7a/gdbserver -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/FirebaseCloudMessaging.identcache: -------------------------------------------------------------------------------- 1 | GC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\CloudMessaging.pasOC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\FirebaseCloudMessaging.dpr -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-large/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-large/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-normal/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-normal/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-small/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-small/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-xlarge/splash_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-xlarge/splash_image.png -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordiCorbilla/BaaSDelphiSamples/HEAD/source/Android/Debug/FirebaseCloudMessaging/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /source/COCApiTest.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=116 3 | DesignerSecs=38 4 | InspectorSecs=1 5 | CompileSecs=349066 6 | OtherSecs=132 7 | StartTime=28/05/2017 22:21:32 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=1 11 | -------------------------------------------------------------------------------- /source/HeaderFooterApplication.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=10 3 | DesignerSecs=1 4 | InspectorSecs=12 5 | CompileSecs=1 6 | OtherSecs=13 7 | StartTime=17/01/2017 21:18:31 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=1 11 | -------------------------------------------------------------------------------- /source/thundax.baas.providers.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=3 3 | DesignerSecs=1 4 | InspectorSecs=1 5 | CompileSecs=10216 6 | OtherSecs=37 7 | StartTime=09/10/2016 16:50:52 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=1 11 | -------------------------------------------------------------------------------- /source/CloudStreaming.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=132 3 | DesignerSecs=392 4 | InspectorSecs=213 5 | CompileSecs=598930 6 | OtherSecs=1412 7 | StartTime=26/11/2016 18:56:44 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=3466 11 | -------------------------------------------------------------------------------- /source/HeaderFooterNavigation.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=6 3 | DesignerSecs=1 4 | InspectorSecs=10 5 | CompileSecs=30376 6 | OtherSecs=65 7 | StartTime=06/11/2016 09:21:28 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=21 11 | -------------------------------------------------------------------------------- /source/thundax.firebase.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=3258 3 | DesignerSecs=821 4 | InspectorSecs=516 5 | CompileSecs=519197 6 | OtherSecs=587 7 | StartTime=06/11/2016 19:50:36 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=4026 11 | -------------------------------------------------------------------------------- /source/urlManagerMobile.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=733 3 | DesignerSecs=86 4 | InspectorSecs=68 5 | CompileSecs=208872 6 | OtherSecs=636 7 | StartTime=25/06/2016 11:28:16 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=532 11 | -------------------------------------------------------------------------------- /source/thundax.testproject.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=7574 3 | DesignerSecs=594 4 | InspectorSecs=192 5 | CompileSecs=3874549 6 | OtherSecs=290 7 | StartTime=16/10/2016 22:23:12 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=12679 11 | -------------------------------------------------------------------------------- /source/FirebaseCloudMessaging.stat: -------------------------------------------------------------------------------- 1 | [Stats] 2 | EditorSecs=567 3 | DesignerSecs=746 4 | InspectorSecs=220 5 | CompileSecs=1681768 6 | OtherSecs=1396 7 | StartTime=17/01/2017 22:16:34 8 | RealKeys=0 9 | EffectiveKeys=0 10 | DebugSecs=7098 11 | -------------------------------------------------------------------------------- /source/COCApiTest.dpr: -------------------------------------------------------------------------------- 1 | program COCApiTest; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | frmCoc in 'frmCoc.pas' {Form4}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.CreateForm(TForm4, Form4); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /source/CloudStreaming.dpr: -------------------------------------------------------------------------------- 1 | program CloudStreaming; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | frmMain in 'frmMain.pas' {main}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.CreateForm(Tmain, main); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /source/ProjectBaaSDelphi.groupproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source/Android/Debug/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /source/Android/Debug/splash_image_def.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /source/urlManagerMobile.identcache: -------------------------------------------------------------------------------- 1 | LC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmUrlManagerMobile.pasIC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\urlManagerMobile.dprAC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.urls.pasDC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.options.pas -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/res/drawable/splash_image_def.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/res/drawable/splash_image_def.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/res/drawable/splash_image_def.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/res/drawable/splash_image_def.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /source/urlManagerMobile.dpr: -------------------------------------------------------------------------------- 1 | program urlManagerMobile; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | frmUrlManagerMobile in 'frmUrlManagerMobile.pas' {Form2}, 7 | lib.options in 'lib.options.pas', 8 | lib.urls in 'lib.urls.pas'; 9 | 10 | {$R *.res} 11 | 12 | begin 13 | Application.Initialize; 14 | Application.CreateForm(TForm2, Form2); 15 | Application.Run; 16 | end. 17 | -------------------------------------------------------------------------------- /source/thundax.testproject.dpr: -------------------------------------------------------------------------------- 1 | program thundax.testproject; 2 | 3 | uses 4 | Vcl.Forms, 5 | uFormTest in 'uFormTest.pas' {Form3}, 6 | Vcl.Themes, 7 | Vcl.Styles; 8 | 9 | {$R *.res} 10 | 11 | begin 12 | Application.Initialize; 13 | Application.MainFormOnTaskbar := True; 14 | TStyleManager.TrySetStyle('Windows10 Blue'); 15 | Application.CreateForm(TForm3, Form3); 16 | Application.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /source/urlManager.dpr: -------------------------------------------------------------------------------- 1 | program urlManager; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmUrlManager in 'frmUrlManager.pas' {Form1}, 6 | Vcl.Themes, 7 | Vcl.Styles, 8 | lib.urls in 'lib.urls.pas', 9 | lib.urls.converter in 'lib.urls.converter.pas'; 10 | 11 | {$R *.res} 12 | 13 | begin 14 | Application.Initialize; 15 | Application.MainFormOnTaskbar := True; 16 | TStyleManager.TrySetStyle('Turquoise Gray'); 17 | Application.CreateForm(TForm1, Form1); 18 | Application.Run; 19 | end. 20 | -------------------------------------------------------------------------------- /source/frmMain.vlb: -------------------------------------------------------------------------------- 1 | [PreviousTabAction1] 2 | Coordinates=204,1,113,33 3 | 4 | [ToolBarLabel] 5 | Coordinates=233,10,80,51 6 | 7 | [ActionList1] 8 | Coordinates=372,1,70,33 9 | 10 | [TitleAction] 11 | Coordinates=255,56,67,33 12 | 13 | [NextTabAction1] 14 | Coordinates=372,56,92,33 15 | 16 | [TopToolBar] 17 | Coordinates=268,188,72,33 18 | 19 | [BottomToolBar] 20 | Coordinates=158,188,89,33 21 | 22 | [Refresh] 23 | Coordinates=255,221,52,33 24 | 25 | [] 26 | Coordinates=334,10,54,51 27 | Visible=True 28 | 29 | -------------------------------------------------------------------------------- /source/thundax.baas.providers.identcache: -------------------------------------------------------------------------------- 1 | DC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.options.pasHC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.kinvey.rest.pasEC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.document.pasIC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.coc.api.rest.pasGC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.parse.rest.pasJC:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.firebase.rest.pas -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase.vsr: -------------------------------------------------------------------------------- 1 | EXPORTED { 2 | global: 3 | _NativeMain; 4 | __rsrc_*; 5 | __rstr_*; 6 | dbkFCallWrapperAddr; 7 | __dbk_fcall_wrapper; 8 | _Unwind_VRS_Get; 9 | _Unwind_VRS_Set; 10 | _Unwind_Complete; 11 | _Unwind_Resume_or_Rethrow; 12 | _Unwind_GetDataRelBase; 13 | _Unwind_GetTextRelBase; 14 | _DbgExcNotify; 15 | _Unwind_GetLanguageSpecificData; 16 | _Unwind_GetRegionStart; 17 | _BorUnwind_RaiseException; 18 | _BorUnwind_Resume; 19 | _UnwindCppFrame; 20 | UnwindCppPersonalityCommon; 21 | _Unwind_DeleteException; 22 | TMethodImplementationIntercept; 23 | ExecJNI; 24 | ANativeActivity_onCreate; 25 | local: *; 26 | }; 27 | -------------------------------------------------------------------------------- /source/frmUrlManagerMobile.LgXhdpiPh.fmx: -------------------------------------------------------------------------------- 1 | inherited Form2_LgXhdpiPh: TForm2_LgXhdpiPh 2 | ClientHeight = 695 3 | ClientWidth = 450 4 | DesignerMasterStyle = 3 5 | inherited TabControl1: TTabControl 6 | Sizes = ( 7 | 329s 8 | 368s 9 | 329s 10 | 368s) 11 | inherited tabCloud: TTabItem 12 | Size.Width = 164.000000000000000000 13 | ExplicitSize.cx = 148.000000000000000000 14 | ExplicitSize.cy = 49.000000000000000000 15 | end 16 | inherited tabDetails: TTabItem 17 | Size.Width = 165.000000000000000000 18 | ExplicitSize.cx = 149.000000000000000000 19 | ExplicitSize.cy = 49.000000000000000000 20 | end 21 | end 22 | inherited BackendStorage1: TBackendStorage 23 | Provider = nil 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /source/frmUrlManagerMobile.LgXhdpiTb.fmx: -------------------------------------------------------------------------------- 1 | inherited Form2_LgXhdpiTb: TForm2_LgXhdpiTb 2 | ClientHeight = 829 3 | ClientWidth = 480 4 | DesignerMasterStyle = 3 5 | inherited TabControl1: TTabControl 6 | Sizes = ( 7 | 329s 8 | 368s 9 | 329s 10 | 368s) 11 | inherited tabCloud: TTabItem 12 | Size.Width = 164.000000000000000000 13 | ExplicitSize.cx = 200.000000000000000000 14 | ExplicitSize.cy = 49.000000000000000000 15 | end 16 | inherited tabDetails: TTabItem 17 | Size.Width = 165.000000000000000000 18 | ExplicitSize.cx = 100.000000000000000000 19 | ExplicitSize.cy = 49.000000000000000000 20 | end 21 | end 22 | inherited BackendStorage1: TBackendStorage 23 | Provider = nil 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /source/Win64/Debug/urlManager.exe 6 | /source/Win64/Debug/frmUrlManager.dcu 7 | /source/Win64/Debug/urlManager.rsm 8 | /source/Win64/Debug 9 | /source/__history 10 | /source/urlManager.identcache 11 | /source/urlManager.stat 12 | /source/Android/Debug/urlManagerMobile/debug/liburlManagerMobile.so 13 | *.so 14 | *.apk 15 | /source/Android/Debug/urlManagerMobile/debug 16 | /source/Android/Debug/urlManagerMobile/library/lib/armeabi-v7a/gdbserver 17 | /source/Android/Debug/urlManagerMobile/classes/classes.dex 18 | *.dcu 19 | *.o 20 | *.exe 21 | -------------------------------------------------------------------------------- /source/COCApiTest.dproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2017/05/28 20:53:16.000.868,=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit4.pas 5 | 2017/05/28 20:54:05.000.879,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmCoc.fmx=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit4.fmx 6 | 2017/05/28 20:54:05.000.879,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmCoc.pas=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit4.pas 7 | 2017/05/28 20:54:17.000.785,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\COCApiTest.dproj=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Project1.dproj 8 | 9 | 10 | -------------------------------------------------------------------------------- /source/FirebaseCloudMessaging.dproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2017/01/17 21:19:55.000.016,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\HeaderFooterApplication.dproj=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\FirebaseCloudMessaging.dproj 5 | 2017/01/17 21:20:06.000.326,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\HeaderFooterTemplate.fmx=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\CloudMessaging.fmx 6 | 2017/01/17 21:20:06.000.326,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\HeaderFooterTemplate.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\CloudMessaging.pas 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /source/thundax.testproject.dproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2016/10/09 19:57:59.000.137,=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit3.pas 5 | 2016/10/09 19:58:24.000.678,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit3.dfm=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\uFormTest.dfm 6 | 2016/10/09 19:58:24.000.678,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit3.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\uFormTest.pas 7 | 2016/10/09 19:58:38.000.058,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Project1.dproj=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\thundax.testproject.dproj 8 | 9 | 10 | -------------------------------------------------------------------------------- /source/frmMain.LgXhdpiPh.fmx: -------------------------------------------------------------------------------- 1 | inherited main_LgXhdpiPh: Tmain_LgXhdpiPh 2 | ClientHeight = 695 3 | ClientWidth = 450 4 | DesignerMasterStyle = 0 5 | inherited TopToolBar: TToolBar 6 | Size.Width = 450.000000000000000000 7 | inherited ToolBarLabel: TLabel 8 | Size.Width = 450.000000000000000000 9 | end 10 | end 11 | inherited BottomToolBar: TToolBar 12 | Position.Y = 647.000000000000000000 13 | Size.Width = 450.000000000000000000 14 | inherited SpeedButton1: TSpeedButton 15 | Position.X = 402.000000000000000000 16 | end 17 | end 18 | inherited ListBox1: TListBox 19 | Size.Width = 450.000000000000000000 20 | Size.Height = 599.000000000000000000 21 | Viewport.Width = 450.000000000000000000 22 | Viewport.Height = 599.000000000000000000 23 | inherited Memo1: TMemo 24 | Viewport.Width = 337.000000000000000000 25 | Viewport.Height = 89.000000000000000000 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /source/frmCoc.fmx: -------------------------------------------------------------------------------- 1 | object Form4: TForm4 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form4' 5 | ClientHeight = 461 6 | ClientWidth = 541 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | DesignerMasterStyle = 0 11 | object Button1: TButton 12 | Position.X = 8.000000000000000000 13 | Position.Y = 8.000000000000000000 14 | Size.Width = 137.000000000000000000 15 | Size.Height = 22.000000000000000000 16 | Size.PlatformDefault = False 17 | TabOrder = 0 18 | Text = 'Get Player Info' 19 | OnClick = Button1Click 20 | end 21 | object Memo1: TMemo 22 | Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] 23 | DataDetectorTypes = [] 24 | Position.X = 8.000000000000000000 25 | Position.Y = 40.000000000000000000 26 | Size.Width = 521.000000000000000000 27 | Size.Height = 409.000000000000000000 28 | Size.PlatformDefault = False 29 | TabOrder = 1 30 | Viewport.Width = 517.000000000000000000 31 | Viewport.Height = 405.000000000000000000 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /source/HeaderFooterFormwithNavigation.iPhone4in.fmx: -------------------------------------------------------------------------------- 1 | inherited HeaderFooterwithNavigation_iPhone4in: THeaderFooterwithNavigation_iPhone4in 2 | ClientHeight = 548 3 | ClientWidth = 320 4 | DesignerMasterStyle = 0 5 | inherited TopToolBar: TToolBar 6 | Size.Width = 320.000000000000000000 7 | inherited ToolBarLabel: TLabel 8 | Size.Width = 320.000000000000000000 9 | end 10 | inherited btnNext: TSpeedButton 11 | Position.X = 276.000000000000000000 12 | end 13 | end 14 | inherited TabControl1: TTabControl 15 | Size.Width = 320.000000000000000000 16 | Size.Height = 460.000000000000000000 17 | inherited TabItem1: TTabItem 18 | ExplicitSize.cx = 8.000000000000000000 19 | ExplicitSize.cy = 8.000000000000000000 20 | end 21 | inherited TabItem2: TTabItem 22 | ExplicitSize.cx = 8.000000000000000000 23 | ExplicitSize.cy = 8.000000000000000000 24 | end 25 | end 26 | inherited BottomToolBar: TToolBar 27 | Position.Y = 504.000000000000000000 28 | Size.Width = 320.000000000000000000 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /source/thundax.baas.providers.dpk: -------------------------------------------------------------------------------- 1 | package thundax.baas.providers; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$IMPLICITBUILD ON} 29 | 30 | requires 31 | rtl, 32 | IndySystem, 33 | IndyProtocols, 34 | IndyCore; 35 | 36 | contains 37 | lib.kinvey.rest in 'lib.kinvey.rest.pas', 38 | lib.parse.rest in 'lib.parse.rest.pas', 39 | lib.firebase.rest in 'lib.firebase.rest.pas', 40 | lib.options in 'lib.options.pas', 41 | lib.document in 'lib.document.pas', 42 | lib.coc.api.rest in 'lib.coc.api.rest.pas'; 43 | 44 | end. 45 | 46 | 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jordi Corbilla 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /source/urlManagerMobile.dproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2016/06/25 09:44:34.000.525,=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit2.pas 5 | 2016/06/25 09:45:14.000.098,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit2.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmUrlManagerMobile.pas 6 | 2016/06/25 09:45:14.000.098,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit2.fmx=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmUrlManagerMobile.fmx 7 | 2016/06/25 09:45:21.000.275,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Project1.dproj=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\urlManagerMobile.dproj 8 | 2016/06/25 10:08:36.000.909,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.urls.pas 9 | 2016/06/25 10:08:36.000.900,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.options.pas 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /source/CloudStreaming.dproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2016/11/06 19:32:37.000.786,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\HeaderFooterNavigation.dproj=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\thundax.firebase.dproj 5 | 2016/11/06 19:32:51.000.027,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\HeaderFooterFormwithNavigation.fmx=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmMain.fmx 6 | 2016/11/06 19:32:51.000.027,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\HeaderFooterFormwithNavigation.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmMain.pas 7 | 2016/11/26 11:21:34.000.342,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\thundax.firebase.dproj=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\FirebaseCloud.dproj 8 | 2016/11/26 11:21:51.000.069,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\FirebaseCloud.dproj=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\CloudStreaming.dproj 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /source/frmMain.iPhone4in.fmx: -------------------------------------------------------------------------------- 1 | inherited main_iPhone4in: Tmain_iPhone4in 2 | ClientHeight = 548 3 | ClientWidth = 320 4 | DesignerMasterStyle = 0 5 | inherited TopToolBar: TToolBar 6 | Size.Width = 320.000000000000000000 7 | Size.Height = 44.000000000000000000 8 | inherited ToolBarLabel: TLabel 9 | Size.Width = 320.000000000000000000 10 | Size.Height = 44.000000000000000000 11 | end 12 | end 13 | inherited BottomToolBar: TToolBar 14 | Position.Y = 504.000000000000000000 15 | Size.Width = 320.000000000000000000 16 | Size.Height = 44.000000000000000000 17 | inherited SpeedButton1: TSpeedButton 18 | Position.X = 276.000000000000000000 19 | Size.Width = 44.000000000000000000 20 | Size.Height = 44.000000000000000000 21 | end 22 | inherited SpeedButton2: TSpeedButton 23 | Size.Width = 26.000000000000000000 24 | Size.Height = 44.000000000000000000 25 | end 26 | end 27 | inherited ListBox1: TListBox 28 | Size.Width = 320.000000000000000000 29 | Size.Height = 460.000000000000000000 30 | Viewport.Width = 316.000000000000000000 31 | Viewport.Height = 456.000000000000000000 32 | inherited Memo1: TMemo 33 | Viewport.Width = 341.000000000000000000 34 | Viewport.Height = 93.000000000000000000 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /source/HeaderFooterFormwithNavigation.LgXhdpiPh.fmx: -------------------------------------------------------------------------------- 1 | inherited HeaderFooterwithNavigation_LgXhdpiPh: THeaderFooterwithNavigation_LgXhdpiPh 2 | ClientHeight = 695 3 | ClientWidth = 450 4 | OnKeyUp = FormKeyUp 5 | DesignerMasterStyle = 0 6 | inherited TopToolBar: TToolBar 7 | Size.Width = 450.000000000000000000 8 | Size.Height = 48.000000000000000000 9 | inherited ToolBarLabel: TLabel 10 | Size.Width = 450.000000000000000000 11 | Size.Height = 48.000000000000000000 12 | end 13 | inherited btnBack: TSpeedButton 14 | Size.Width = 48.000000000000000000 15 | Size.Height = 48.000000000000000000 16 | Visible = False 17 | end 18 | inherited btnNext: TSpeedButton 19 | Position.X = 402.000000000000000000 20 | Size.Width = 48.000000000000000000 21 | Size.Height = 48.000000000000000000 22 | end 23 | end 24 | inherited TabControl1: TTabControl 25 | Size.Width = 450.000000000000000000 26 | Size.Height = 599.000000000000000000 27 | inherited TabItem1: TTabItem 28 | ExplicitSize.cx = 8.000000000000000000 29 | ExplicitSize.cy = 8.000000000000000000 30 | end 31 | inherited TabItem2: TTabItem 32 | ExplicitSize.cx = 8.000000000000000000 33 | ExplicitSize.cy = 8.000000000000000000 34 | end 35 | end 36 | inherited BottomToolBar: TToolBar 37 | Position.Y = 647.000000000000000000 38 | Size.Width = 450.000000000000000000 39 | Size.Height = 48.000000000000000000 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /source/lib.parse.rest.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.parse.rest; 29 | 30 | interface 31 | 32 | implementation 33 | 34 | end. 35 | -------------------------------------------------------------------------------- /source/FirebaseCloudMessaging.dpr: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | program FirebaseCloudMessaging; 29 | 30 | uses 31 | System.StartUpCopy, 32 | FMX.Forms, 33 | CloudMessaging in 'CloudMessaging.pas' {frmMain}; 34 | 35 | {$R *.res} 36 | 37 | begin 38 | Application.Initialize; 39 | Application.CreateForm(TfrmMain, frmMain); 40 | Application.Run; 41 | end. 42 | -------------------------------------------------------------------------------- /source/AndroidManifest.template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | <%uses-permission%> 12 | 13 | 14 | 22 | 23 | <%application-meta-data%> 24 | <%services%> 25 | 27 | 31 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | <%activity%> 40 | <%receivers%> 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /source/urlManager.dproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2016/06/23 23:10:13.000.792,=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit1.pas 5 | 2016/06/23 23:11:04.000.637,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit1.dfm=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmUrlManager.dfm 6 | 2016/06/23 23:11:04.000.637,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Unit1.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\frmUrlManager.pas 7 | 2016/06/23 23:11:12.000.357,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Project1.dproj=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\urlManager.dproj 8 | 2016/06/23 23:23:17.000.792,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 9 | 2016/06/23 23:23:35.000.984,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.kinvey.rest.pas 10 | 2016/06/23 23:26:28.000.003,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 11 | 2016/06/23 23:26:39.000.456,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.urls.pas 12 | 2016/06/23 23:53:48.000.550,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 13 | 2016/06/23 23:53:55.000.486,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.options.pas 14 | 2016/06/25 09:18:23.000.596,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 15 | 2016/06/25 09:18:34.000.738,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.urls.converter.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 16 | 2016/10/09 16:47:33.000.554,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.kinvey.rest.pas= 17 | 2016/10/09 16:50:47.000.013,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.options.pas= 18 | 19 | 20 | -------------------------------------------------------------------------------- /source/frmCoc.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit frmCoc; 29 | 30 | interface 31 | 32 | uses 33 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 34 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.ScrollBox, 35 | FMX.Memo, FMX.Controls.Presentation, FMX.StdCtrls; 36 | 37 | type 38 | TForm4 = class(TForm) 39 | Button1: TButton; 40 | Memo1: TMemo; 41 | procedure Button1Click(Sender: TObject); 42 | private 43 | { Private declarations } 44 | public 45 | { Public declarations } 46 | end; 47 | 48 | var 49 | Form4: TForm4; 50 | 51 | implementation 52 | 53 | uses 54 | lib.coc.api.rest; 55 | 56 | {$R *.fmx} 57 | 58 | procedure TForm4.Button1Click(Sender: TObject); 59 | var 60 | response : string; 61 | begin 62 | response:= TCOCApiRest.New().GetUserInfo('8RPC8VGQY'); 63 | Memo1.Lines.Clear; 64 | Memo1.Lines.Add(response); 65 | end; 66 | 67 | end. 68 | -------------------------------------------------------------------------------- /source/frmUrlManager.dfm: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu, biMinimize] 5 | BorderStyle = bsDialog 6 | Caption = 'Url Manager by Jordi Corbilla' 7 | ClientHeight = 536 8 | ClientWidth = 765 9 | Color = clBtnFace 10 | Font.Charset = DEFAULT_CHARSET 11 | Font.Color = clWindowText 12 | Font.Height = -11 13 | Font.Name = 'Tahoma' 14 | Font.Style = [] 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | PixelsPerInch = 96 19 | TextHeight = 13 20 | object Label1: TLabel 21 | Left = 24 22 | Top = 27 23 | Width = 26 24 | Height = 13 25 | Caption = 'User:' 26 | end 27 | object Label2: TLabel 28 | Left = 224 29 | Top = 27 30 | Width = 50 31 | Height = 13 32 | Caption = 'Password:' 33 | end 34 | object Label3: TLabel 35 | Left = 24 36 | Top = 59 37 | Width = 17 38 | Height = 13 39 | Caption = 'Url:' 40 | end 41 | object Label4: TLabel 42 | Left = 24 43 | Top = 145 44 | Width = 63 45 | Height = 13 46 | Caption = 'Cloud data:' 47 | Font.Charset = DEFAULT_CHARSET 48 | Font.Color = clWindowText 49 | Font.Height = -11 50 | Font.Name = 'Tahoma' 51 | Font.Style = [fsBold] 52 | ParentFont = False 53 | end 54 | object ListView1: TListView 55 | Left = 24 56 | Top = 164 57 | Width = 713 58 | Height = 345 59 | Columns = < 60 | item 61 | Caption = 'User' 62 | Width = 100 63 | end 64 | item 65 | Caption = 'Password' 66 | Width = 100 67 | end 68 | item 69 | Caption = 'Url' 70 | Width = 480 71 | end> 72 | GridLines = True 73 | RowSelect = True 74 | TabOrder = 0 75 | ViewStyle = vsReport 76 | end 77 | object edtUser: TEdit 78 | Left = 56 79 | Top = 24 80 | Width = 137 81 | Height = 21 82 | TabOrder = 1 83 | end 84 | object edtPassword: TEdit 85 | Left = 280 86 | Top = 24 87 | Width = 137 88 | Height = 21 89 | TabOrder = 2 90 | end 91 | object edtUrl: TMemo 92 | Left = 56 93 | Top = 56 94 | Width = 681 95 | Height = 65 96 | TabOrder = 3 97 | end 98 | object Button1: TButton 99 | Left = 662 100 | Top = 25 101 | Width = 75 102 | Height = 25 103 | Caption = 'Add' 104 | TabOrder = 4 105 | OnClick = Button1Click 106 | end 107 | object Button2: TButton 108 | Left = 662 109 | Top = 133 110 | Width = 75 111 | Height = 25 112 | Caption = 'Reload' 113 | TabOrder = 5 114 | OnClick = Button2Click 115 | end 116 | end 117 | -------------------------------------------------------------------------------- /source/Android/Debug/CloudStreaming/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | 36 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /source/Android/Debug/urlManagerMobile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | 36 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /source/Android/Debug/thundax.firebase/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | 36 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /source/CloudMessaging.fmx: -------------------------------------------------------------------------------- 1 | object frmMain: TfrmMain 2 | Left = 0 3 | Top = 0 4 | ClientHeight = 567 5 | ClientWidth = 384 6 | FormFactor.Width = 1440 7 | FormFactor.Height = 900 8 | FormFactor.Devices = [Desktop] 9 | OnCreate = FormCreate 10 | DesignerMasterStyle = 3 11 | object Header: TToolBar 12 | Size.Width = 384.000000000000000000 13 | Size.Height = 48.000000000000000000 14 | Size.PlatformDefault = False 15 | TabOrder = 0 16 | object HeaderLabel: TLabel 17 | Align = Contents 18 | Size.Width = 384.000000000000000000 19 | Size.Height = 48.000000000000000000 20 | Size.PlatformDefault = False 21 | StyleLookup = 'toollabel' 22 | TextSettings.HorzAlign = Center 23 | Text = 'Firebase Cloud Messaging' 24 | end 25 | end 26 | object Footer: TToolBar 27 | Align = Bottom 28 | Position.Y = 519.000000000000000000 29 | Size.Width = 384.000000000000000000 30 | Size.Height = 48.000000000000000000 31 | Size.PlatformDefault = False 32 | StyleLookup = 'bottomtoolbar' 33 | TabOrder = 1 34 | object SpeedButton2: TSpeedButton 35 | Align = MostLeft 36 | Size.Width = 48.000000000000000000 37 | Size.Height = 48.000000000000000000 38 | Size.PlatformDefault = False 39 | StyleLookup = 'infotoolbutton' 40 | OnClick = ShowTokenExecute 41 | end 42 | object SpeedButton1: TSpeedButton 43 | Align = MostLeft 44 | Position.X = 48.000000000000000000 45 | Size.Width = 48.000000000000000000 46 | Size.Height = 48.000000000000000000 47 | Size.PlatformDefault = False 48 | StyleLookup = 'nexttoolbutton' 49 | OnClick = RegisterDeviceExecute 50 | end 51 | end 52 | object Memo1: TMemo 53 | Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] 54 | DataDetectorTypes = [] 55 | StyledSettings = [Style, Other] 56 | TextSettings.Font.Family = 'Calibri' 57 | TextSettings.Font.Size = 10.000000000000000000 58 | TextSettings.WordWrap = True 59 | Align = Client 60 | Size.Width = 384.000000000000000000 61 | Size.Height = 471.000000000000000000 62 | Size.PlatformDefault = False 63 | StyleLookup = 'memostyle' 64 | TabOrder = 3 65 | Viewport.Width = 376.000000000000000000 66 | Viewport.Height = 463.000000000000000000 67 | end 68 | object ActionList1: TActionList 69 | Left = 176 70 | Top = 56 71 | object TitleAction: TControlAction 72 | Category = 'Tab' 73 | Text = 'TitleAction' 74 | end 75 | object PreviousTabAction1: TPreviousTabAction 76 | Category = 'Tab' 77 | ShortCut = 137 78 | end 79 | object NextTabAction1: TNextTabAction 80 | Category = 'Tab' 81 | end 82 | object ShowToken: TAction 83 | Text = 'ShowToken' 84 | OnExecute = ShowTokenExecute 85 | end 86 | object RegisterDevice: TAction 87 | Text = 'RegisterDevice' 88 | OnExecute = RegisterDeviceExecute 89 | end 90 | end 91 | object StyleBook1: TStyleBook 92 | Styles = <> 93 | Left = 216 94 | Top = 256 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /source/lib.urls.converter.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.urls.converter; 29 | 30 | interface 31 | 32 | uses 33 | System.Contnrs, Generics.Collections, lib.urls; 34 | 35 | type 36 | TUrlConverter = class(TObject) 37 | private 38 | FJsonString : string; 39 | public 40 | constructor Create(jsonString : string); 41 | function GetCollection() : TList; 42 | end; 43 | 44 | implementation 45 | 46 | uses 47 | DBXJSON, System.JSON, System.SysUtils; 48 | 49 | { TUrlConverter } 50 | 51 | constructor TUrlConverter.Create(jsonString: string); 52 | begin 53 | FJsonString := jsonString; 54 | end; 55 | 56 | function TUrlConverter.GetCollection: TList; 57 | var 58 | LJsonArr : TJSONArray; 59 | LJsonValue : TJSONValue; 60 | LItem : TJSONValue; 61 | user : string; 62 | password : string; 63 | url : string; 64 | collection : TList; 65 | begin 66 | collection := TList.create(); 67 | try 68 | LJsonArr := TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(FJsonString),0) as TJSONArray; 69 | for LJsonValue in LJsonArr do 70 | begin 71 | for LItem in TJSONArray(LJsonValue) do 72 | begin 73 | if (TJSONPair(LItem).JsonString.Value = 'user') then 74 | user := TJSONPair(LItem).JsonValue.Value; 75 | if (TJSONPair(LItem).JsonString.Value = 'password') then 76 | password := TJSONPair(LItem).JsonValue.Value; 77 | if (TJSONPair(LItem).JsonString.Value = 'url') then 78 | url := TJSONPair(LItem).JsonValue.Value; 79 | end; 80 | collection.Add(TUrls.Create(user, password, url)); 81 | end; 82 | finally 83 | result := collection; 84 | end; 85 | end; 86 | 87 | end. 88 | -------------------------------------------------------------------------------- /source/lib.coc.api.rest.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.coc.api.rest; 29 | 30 | interface 31 | 32 | uses 33 | IdHTTP, IdIOHandler, IdIOHandlerStream, 34 | IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdGlobal, 35 | System.SysUtils, System.Variants, System.Classes, lib.options, 36 | IdSSLOpenSSLHeaders_Static, System.IOUtils; 37 | 38 | type 39 | ICOCApiRest = interface 40 | function GetUserInfo(user : string): string; 41 | end; 42 | 43 | TCOCApiRest = class(TInterfacedObject, ICOCApiRest) 44 | private 45 | FOptions : IOptions; 46 | public 47 | function GetUserInfo(user : string): string; 48 | constructor Create(); 49 | class function New() : ICOCApiRest; 50 | end; 51 | 52 | implementation 53 | 54 | //Example: 55 | //curl -X GET --header 'Accept: application/json' --header "authorization: Bearer " 'https://api.clashofclans.com/v1/players/%238RPC8VGQY' 56 | 57 | constructor TCOCApiRest.Create; 58 | begin 59 | FOptions := TOptions.New.Load; 60 | end; 61 | 62 | function TCOCApiRest.GetUserInfo(user : string): string; 63 | var 64 | IdHTTP: TIdHTTP; 65 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 66 | response : string; 67 | begin 68 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 69 | try 70 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 71 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 72 | IdHTTP := TIdHTTP.Create(nil); 73 | try 74 | IdHTTP.IOHandler := IdIOHandler; 75 | IdHTTP.ReadTimeout := IdTimeoutInfinite; 76 | IdHTTP.Request.Connection := 'Keep-Alive'; 77 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 78 | IdHTTP.Request.CustomHeaders.Clear; 79 | IdHTTP.Request.CustomHeaders.Values['authorization'] := 'Bearer ' + FOptions.COCToken; 80 | IdHTTP.Request.ContentType := 'application/json'; 81 | response := IdHTTP.Get('https://api.clashofclans.com/v1/players/%23'+user); 82 | result := response; 83 | finally 84 | IdHTTP.Free; 85 | end; 86 | finally 87 | IdIOHandler.Free; 88 | end; 89 | end; 90 | 91 | class function TCOCApiRest.New: ICOCApiRest; 92 | begin 93 | result := Create; 94 | end; 95 | 96 | end. 97 | -------------------------------------------------------------------------------- /source/Android/Debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 37 | 38 | 39 | 40 | 42 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /source/Android/Debug/FirebaseCloudMessaging/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 37 | 38 | 39 | 40 | 42 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /source/lib.urls.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.urls; 29 | 30 | interface 31 | 32 | type 33 | IUrls = interface 34 | procedure SetPassword(const Value: string); 35 | procedure SetUrl(const Value: string); 36 | procedure SetUser(const Value: string); 37 | function GetUser() : string; 38 | function GetPasword() : string; 39 | function GetUrl() : string; 40 | property User : string read GetUser write SetUser; 41 | property Password : string read GetPasword write SetPassword; 42 | property Url : string read GetUrl write SetUrl; 43 | function ToJsonString() : string; 44 | end; 45 | 46 | TUrls = class(TInterfacedObject, IUrls) 47 | private 48 | FPassword: string; 49 | FUrl: string; 50 | FUser: string; 51 | procedure SetPassword(const Value: string); 52 | procedure SetUrl(const Value: string); 53 | procedure SetUser(const Value: string); 54 | function GetUser() : string; 55 | function GetPasword() : string; 56 | function GetUrl() : string; 57 | public 58 | property User : string read GetUser write SetUser; 59 | property Password : string read GetPasword write SetPassword; 60 | property Url : string read GetUrl write SetUrl; 61 | Constructor Create(user, password, url : string); 62 | function ToJsonString() : string; 63 | end; 64 | 65 | implementation 66 | 67 | { TUrls } 68 | 69 | constructor TUrls.Create(user, password, url: string); 70 | begin 71 | SetUser(user); 72 | SetPassword(password); 73 | SetUrl(url); 74 | end; 75 | 76 | function TUrls.GetPasword: string; 77 | begin 78 | result := FPassword; 79 | end; 80 | 81 | function TUrls.GetUrl: string; 82 | begin 83 | result := FUrl; 84 | end; 85 | 86 | function TUrls.GetUser: string; 87 | begin 88 | result := FUser; 89 | end; 90 | 91 | procedure TUrls.SetPassword(const Value: string); 92 | begin 93 | FPassword := Value; 94 | end; 95 | 96 | procedure TUrls.SetUrl(const Value: string); 97 | begin 98 | FUrl := Value; 99 | end; 100 | 101 | procedure TUrls.SetUser(const Value: string); 102 | begin 103 | FUser := Value; 104 | end; 105 | 106 | function TUrls.ToJsonString: string; 107 | begin 108 | result := '{"user":"'+FUser+'","password":"'+FPassword+'","url":"'+FUrl+'"}' 109 | end; 110 | 111 | end. 112 | -------------------------------------------------------------------------------- /source/frmUrlManager.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit frmUrlManager; 29 | 30 | interface 31 | 32 | uses 33 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 34 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls; 35 | 36 | type 37 | TForm1 = class(TForm) 38 | ListView1: TListView; 39 | edtUser: TEdit; 40 | Label1: TLabel; 41 | edtPassword: TEdit; 42 | Label2: TLabel; 43 | Label3: TLabel; 44 | edtUrl: TMemo; 45 | Button1: TButton; 46 | Button2: TButton; 47 | Label4: TLabel; 48 | procedure Button1Click(Sender: TObject); 49 | procedure Button2Click(Sender: TObject); 50 | procedure FormCreate(Sender: TObject); 51 | private 52 | { Private declarations } 53 | public 54 | { Public declarations } 55 | end; 56 | 57 | var 58 | Form1: TForm1; 59 | 60 | implementation 61 | 62 | uses 63 | lib.urls, lib.kinvey.rest, lib.urls.converter, System.Contnrs, Generics.Collections; 64 | 65 | {$R *.dfm} 66 | 67 | procedure TForm1.Button1Click(Sender: TObject); 68 | var 69 | url : IUrls; 70 | begin 71 | url := TUrls.Create(edtUser.Text, edtPassword.Text, edtUrl.Text); 72 | if TKinveyRest.New.Add(url.ToJsonString()) then 73 | begin 74 | showMessage('Item has been successfully added!'); 75 | edtUser.Text := ''; 76 | edtPassword.Text := ''; 77 | edtUrl.Clear; 78 | Button2Click(sender); 79 | end 80 | else 81 | showMessage('There was an error adding the data to the cloud storage'); 82 | end; 83 | 84 | procedure TForm1.Button2Click(Sender: TObject); 85 | var 86 | collection : string; 87 | jsonConverter : TUrlConverter; 88 | listUrls : TList; 89 | url : IUrls; 90 | listItem : TListItem; 91 | begin 92 | Listview1.Clear; 93 | collection := TKinveyRest.New.GetCollection(); 94 | jsonConverter := TUrlConverter.Create(collection); 95 | listUrls := jsonConverter.GetCollection(); 96 | for url in listUrls do 97 | begin 98 | listItem := Listview1.Items.Add; 99 | listItem.Caption := url.User; 100 | listItem.SubItems.Add(url.Password); 101 | listItem.SubItems.Add(url.Url); 102 | end; 103 | end; 104 | 105 | procedure TForm1.FormCreate(Sender: TObject); 106 | begin 107 | Button2Click(sender); 108 | end; 109 | 110 | end. 111 | -------------------------------------------------------------------------------- /source/thundax.baas.providers.dproj.local: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2016/10/09 16:44:38.000.070,=rtl.dcp 5 | 2016/10/09 16:45:39.000.139,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\thundax.baas.dproj=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\Package1.dproj 6 | 2016/10/09 16:45:47.000.336,C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\thundax.baas.providers.dproj=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\thundax.baas.dproj 7 | 2016/10/09 16:46:19.000.542,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\thundax.baas.providers.dproj=C:\Users\thund\OneDrive\Documents\Embarcadero\Studio\Projects\thundax.baas.providers.dproj 8 | 2016/10/09 16:46:32.000.350,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.kinvey.rest.pas 9 | 2016/10/09 16:48:23.000.611,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 10 | 2016/10/09 16:48:33.000.129,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.parse.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 11 | 2016/10/09 16:48:38.000.474,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 12 | 2016/10/09 16:48:52.000.493,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.firebase.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 13 | 2016/10/09 16:49:03.000.494,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.parse.rest.res=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.parse.res 14 | 2016/10/09 16:49:18.000.541,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.firebase.rest.res=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.firebase.res 15 | 2016/10/09 16:50:24.000.961,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.options.pas 16 | 2016/10/18 23:07:04.000.459,=IndySystem.dcp 17 | 2016/10/18 23:07:04.000.467,=IndyProtocols.dcp 18 | 2016/10/18 23:07:04.000.475,=IndyCore.dcp 19 | 2016/11/10 22:27:41.000.579,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 20 | 2016/11/10 22:27:52.000.857,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.document.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 21 | 2016/11/25 19:58:07.000.339,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 22 | 2016/11/25 19:58:22.000.838,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.runThread.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 23 | 2016/11/26 08:04:40.000.291,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.runThread.pas= 24 | 2016/11/26 08:55:18.000.768,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.runThread.pas 25 | 2016/11/26 09:02:58.000.715,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.runThread.pas= 26 | 2017/05/28 20:56:38.000.650,=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas 27 | 2017/05/28 20:56:48.000.401,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\Unit1.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.coc.api.res.pas 28 | 2017/05/28 21:16:22.000.706,C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.coc.api.res.pas=C:\Users\thund\Source\Repos\BaaSDelphiSamples\source\lib.coc.api.rest.pas 29 | 30 | 31 | -------------------------------------------------------------------------------- /source/lib.runThread.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.runThread; 29 | 30 | interface 31 | 32 | uses 33 | System.Classes, REST.Client, Generics.collections, FMX.StdCtrls, FMX.Objects; 34 | 35 | type 36 | TRunThread = class(TThread) 37 | private 38 | FListNodes : TList; 39 | FRequest: TRESTRequest; 40 | FResponse: TRESTResponse; 41 | FAniIndicator: TAniIndicator; 42 | public 43 | constructor Create(request: TRESTRequest; response: TRESTResponse; nodes : TList; AniIndicator: TAniIndicator); reintroduce; 44 | protected 45 | procedure Execute; override; 46 | end; 47 | 48 | implementation 49 | 50 | uses 51 | System.JSON, System.SysUtils, System.Net.HttpClient; 52 | 53 | constructor TRunThread.Create(request: TRESTRequest; response: TRESTResponse; nodes : TList; AniIndicator: TAniIndicator); 54 | begin 55 | inherited Create(True); 56 | FreeOnTerminate := True; 57 | FListNodes := nodes; 58 | FRequest := request; 59 | FResponse := response; 60 | FAniIndicator := AniIndicator; 61 | end; 62 | 63 | procedure TRunThread.Execute; 64 | var 65 | node : TNode; 66 | jValue: TJSONValue; 67 | LJsonArr : TJSONArray; 68 | LJsonValue : TJSONValue; 69 | LItem : TJSONValue; 70 | status : string; 71 | begin 72 | Synchronize( 73 | procedure () 74 | begin 75 | FAniIndicator.Visible := true; 76 | FAniIndicator.Enabled := true; 77 | end 78 | ); 79 | 80 | for node in FListNodes do 81 | begin 82 | Synchronize( 83 | procedure () 84 | begin 85 | node.labelNode.Text := 'Checking'; 86 | node.RoundRect.Fill.Color := 4294934352; 87 | end 88 | ); 89 | FRequest.Resource := node.Action; 90 | try 91 | FRequest.Execute; 92 | jValue := FResponse.JSONValue; 93 | LJsonArr := TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(jValue.ToString),0) as TJSONArray; 94 | for LJsonValue in LJsonArr do 95 | begin 96 | for LItem in TJSONArray(LJsonValue) do 97 | begin 98 | if (TJSONPair(LItem).JsonString.Value = 'host') then 99 | begin 100 | status := TJSONPair(LItem).JsonValue.Value; 101 | Synchronize( 102 | procedure () 103 | begin 104 | if status.Equals('alive') then 105 | begin 106 | node.labelNode.Text := 'Alive'; 107 | node.RoundRect.Fill.Color := node.ColorOn; 108 | end 109 | else 110 | begin 111 | node.labelNode.Text := 'Dead'; 112 | node.RoundRect.Fill.Color := node.ColorOff; 113 | end; 114 | end 115 | ); 116 | end; 117 | end; 118 | end; 119 | except 120 | on e : Exception do 121 | begin 122 | Synchronize( 123 | procedure () 124 | begin 125 | FAniIndicator.Visible := false; 126 | FAniIndicator.Enabled := false; 127 | end 128 | ); 129 | end; 130 | end; 131 | end; 132 | 133 | Synchronize( 134 | procedure () 135 | begin 136 | FAniIndicator.Visible := false; 137 | FAniIndicator.Enabled := false; 138 | end 139 | ); 140 | end; 141 | 142 | end. 143 | -------------------------------------------------------------------------------- /source/frmMain.fmx: -------------------------------------------------------------------------------- 1 | object main: Tmain 2 | Left = 0 3 | Top = 0 4 | Caption = 'Home' 5 | ClientHeight = 568 6 | ClientWidth = 384 7 | FormFactor.Width = 1440 8 | FormFactor.Height = 900 9 | FormFactor.Devices = [Desktop] 10 | OnCreate = FormCreate 11 | DesignerMasterStyle = 0 12 | object TopToolBar: TToolBar 13 | Anchors = [] 14 | Size.Width = 384.000000000000000000 15 | Size.Height = 48.000000000000000000 16 | Size.PlatformDefault = False 17 | TabOrder = 1 18 | object ToolBarLabel: TLabel 19 | Action = TitleAction 20 | Align = Contents 21 | Enabled = True 22 | Size.Width = 384.000000000000000000 23 | Size.Height = 48.000000000000000000 24 | Size.PlatformDefault = False 25 | StyleLookup = 'toollabel' 26 | TextSettings.HorzAlign = Center 27 | Text = 'Firebase Cloud Storage (by Jordi Corbilla)' 28 | Visible = True 29 | end 30 | end 31 | object BottomToolBar: TToolBar 32 | Align = Bottom 33 | Anchors = [akLeft] 34 | Position.Y = 520.000000000000000000 35 | Size.Width = 384.000000000000000000 36 | Size.Height = 48.000000000000000000 37 | Size.PlatformDefault = False 38 | StyleLookup = 'bottomtoolbar' 39 | TabOrder = 2 40 | object SpeedButton1: TSpeedButton 41 | Action = Refresh 42 | Align = MostRight 43 | Enabled = True 44 | ImageIndex = -1 45 | Position.X = 336.000000000000000000 46 | Size.Width = 48.000000000000000000 47 | Size.Height = 48.000000000000000000 48 | Size.PlatformDefault = False 49 | StyleLookup = 'refreshtoolbutton' 50 | Visible = True 51 | end 52 | object SpeedButton2: TSpeedButton 53 | Action = Upload 54 | Align = MostLeft 55 | Enabled = True 56 | ImageIndex = -1 57 | Size.Width = 48.000000000000000000 58 | Size.Height = 48.000000000000000000 59 | Size.PlatformDefault = False 60 | StyleLookup = 'additembutton' 61 | Visible = True 62 | end 63 | object Button1: TButton 64 | Position.X = 160.000000000000000000 65 | Position.Y = 16.000000000000000000 66 | TabOrder = 1 67 | Text = 'Button1' 68 | Visible = False 69 | OnClick = Button1Click 70 | end 71 | end 72 | object ListBox1: TListBox 73 | Align = Client 74 | Size.Width = 384.000000000000000000 75 | Size.Height = 472.000000000000000000 76 | Size.PlatformDefault = False 77 | TabOrder = 0 78 | DisableFocusEffect = True 79 | DefaultItemStyles.ItemStyle = '' 80 | DefaultItemStyles.GroupHeaderStyle = '' 81 | DefaultItemStyles.GroupFooterStyle = '' 82 | Viewport.Width = 380.000000000000000000 83 | Viewport.Height = 468.000000000000000000 84 | object Panel1: TPanel 85 | Align = Client 86 | Size.Width = 380.000000000000000000 87 | Size.Height = 468.000000000000000000 88 | Size.PlatformDefault = False 89 | Visible = False 90 | TabOrder = 0 91 | object Label1: TLabel 92 | Align = Client 93 | StyledSettings = [Family, Style, FontColor] 94 | Size.Width = 380.000000000000000000 95 | Size.Height = 468.000000000000000000 96 | Size.PlatformDefault = False 97 | TextSettings.Font.Size = 25.000000000000000000 98 | TextSettings.HorzAlign = Center 99 | Text = 'Please wait' 100 | end 101 | object AniIndicator2: TAniIndicator 102 | Align = Center 103 | Enabled = True 104 | Size.Width = 244.000000000000000000 105 | Size.Height = 236.000000000000000000 106 | Size.PlatformDefault = False 107 | Visible = False 108 | object FloatAnimation2: TFloatAnimation 109 | Enabled = True 110 | Duration = 0.200000002980232200 111 | Loop = True 112 | PropertyName = 'RotationAngle' 113 | StartValue = 0.000000000000000000 114 | StopValue = 0.000000000000000000 115 | Trigger = 'IsVisible=true' 116 | end 117 | end 118 | end 119 | object Memo1: TMemo 120 | Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] 121 | DataDetectorTypes = [] 122 | Position.X = 16.000000000000000000 123 | Position.Y = 360.000000000000000000 124 | Size.Width = 345.000000000000000000 125 | Size.Height = 97.000000000000000000 126 | Size.PlatformDefault = False 127 | TabOrder = 1 128 | Viewport.Width = 341.000000000000000000 129 | Viewport.Height = 93.000000000000000000 130 | end 131 | end 132 | object OpenDialog1: TOpenDialog 133 | Left = 176 134 | Top = 136 135 | end 136 | object ActionList1: TActionList 137 | Left = 176 138 | Top = 56 139 | object TitleAction: TControlAction 140 | Category = 'Tab' 141 | Text = 'TitleAction' 142 | end 143 | object PreviousTabAction1: TPreviousTabAction 144 | Category = 'Tab' 145 | ShortCut = 137 146 | end 147 | object NextTabAction1: TNextTabAction 148 | Category = 'Tab' 149 | end 150 | object Refresh: TAction 151 | OnExecute = RefreshExecute 152 | end 153 | object Upload: TAction 154 | OnExecute = UploadExecute 155 | end 156 | end 157 | end 158 | -------------------------------------------------------------------------------- /source/lib.kinvey.rest.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.kinvey.rest; 29 | 30 | interface 31 | 32 | uses 33 | IdHTTP, IdIOHandler, IdIOHandlerStream, 34 | IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdGlobal, 35 | System.SysUtils, System.Variants, System.Classes, lib.options; 36 | 37 | type 38 | IKinveyRest = interface 39 | function Add(jsonString: string) : boolean; 40 | function GetCollection() : string; 41 | end; 42 | 43 | TKinveyRest = class(TInterfacedObject, IKinveyRest) 44 | private 45 | FOptions : IOptions; 46 | public 47 | function Add(jsonString: string) : boolean; 48 | function GetCollection() : string; 49 | constructor Create(); 50 | class function New() : IKinveyRest; 51 | end; 52 | 53 | implementation 54 | 55 | uses 56 | IdCoderMIME; 57 | 58 | { TKinveyRest } 59 | 60 | function TKinveyRest.Add(jsonString: string) : boolean; 61 | var 62 | IdHTTP: TIdHTTP; 63 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 64 | response : string; 65 | JsonToSend: TStringStream; 66 | encodedHeader : string; 67 | begin 68 | JsonToSend := TStringStream.Create(jsonString); 69 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 70 | try 71 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 72 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 73 | IdHTTP := TIdHTTP.Create(nil); 74 | try 75 | IdHTTP.IOHandler := IdIOHandler; 76 | IdHTTP.Request.Connection := 'Keep-Alive'; 77 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 78 | IdHTTP.Request.CustomHeaders.Clear; 79 | encodedHeader := TIdEncoderMIME.EncodeString(FOptions.AppId + ':' + FOptions.MasterSecret); 80 | IdHTTP.Request.CustomHeaders.Values['Authorization'] := 'Basic ' + encodedHeader; 81 | IdHTTP.Request.CustomHeaders.Values['X-Kinvey-API-Version'] := '3'; 82 | IdHTTP.Request.ContentType := 'application/json'; 83 | response := IdHTTP.Post('https://baas.kinvey.com/appdata/'+FOptions.AppId+'/'+FOptions.Collection+'/', JsonToSend); 84 | response := response.Replace(Char(#10), ''); 85 | result := (response.Contains('creator')); 86 | finally 87 | IdHTTP.Free; 88 | end; 89 | finally 90 | IdIOHandler.Free; 91 | JsonToSend.Free; 92 | end; 93 | end; 94 | 95 | constructor TKinveyRest.Create; 96 | begin 97 | FOptions := TOptions.New.Load; 98 | end; 99 | 100 | function TKinveyRest.GetCollection: string; 101 | var 102 | IdHTTP: TIdHTTP; 103 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 104 | response : string; 105 | encodedHeader : string; 106 | begin 107 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 108 | try 109 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 110 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 111 | IdHTTP := TIdHTTP.Create(nil); 112 | try 113 | IdHTTP.IOHandler := IdIOHandler; 114 | IdHTTP.Request.Connection := 'Keep-Alive'; 115 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 116 | IdHTTP.Request.CustomHeaders.Clear; 117 | encodedHeader := TIdEncoderMIME.EncodeString(FOptions.AppId + ':' + FOptions.MasterSecret); 118 | IdHTTP.Request.CustomHeaders.Values['Authorization'] := 'Basic ' + encodedHeader; 119 | IdHTTP.Request.CustomHeaders.Values['X-Kinvey-API-Version'] := '3'; 120 | IdHTTP.Request.ContentType := 'application/json'; 121 | response := IdHTTP.Get('https://baas.kinvey.com/appdata/'+FOptions.AppId+'/'+FOptions.Collection+'/'); 122 | result := response; 123 | finally 124 | IdHTTP.Free; 125 | end; 126 | finally 127 | IdIOHandler.Free; 128 | end; 129 | end; 130 | 131 | class function TKinveyRest.New: IKinveyRest; 132 | begin 133 | result := Create; 134 | end; 135 | 136 | end. 137 | -------------------------------------------------------------------------------- /source/ProjectBaaSDelphi.groupproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {8B13298D-EFE6-4813-AA91-EC97FAD4C8C6} 4 | 5 | 6 | 7 | 8 | 9 | 10 | thundax.baas.providers.dproj 11 | 12 | 13 | 14 | 15 | 16 | thundax.baas.providers.dproj 17 | 18 | 19 | 20 | 21 | 22 | thundax.baas.providers.dproj 23 | 24 | 25 | thundax.baas.providers.dproj 26 | 27 | 28 | 29 | Default.Personality.12 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /source/uFormTest.dfm: -------------------------------------------------------------------------------- 1 | object Form3: TForm3 2 | Left = 0 3 | Top = 0 4 | Caption = 'Delphi Firebase Example by Jordi Corbilla' 5 | ClientHeight = 609 6 | ClientWidth = 1031 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OldCreateOrder = False 14 | PixelsPerInch = 96 15 | TextHeight = 13 16 | object PageControl1: TPageControl 17 | Left = 0 18 | Top = 0 19 | Width = 1031 20 | Height = 609 21 | ActivePage = TabSheet2 22 | Align = alClient 23 | TabOrder = 0 24 | ExplicitLeft = 48 25 | ExplicitTop = 16 26 | ExplicitWidth = 289 27 | ExplicitHeight = 193 28 | object TabSheet1: TTabSheet 29 | Caption = 'Realtime DB' 30 | ExplicitWidth = 281 31 | ExplicitHeight = 165 32 | object Button1: TButton 33 | Left = 8 34 | Top = 8 35 | Width = 201 36 | Height = 25 37 | Caption = 'Load Documents From Firebase' 38 | TabOrder = 0 39 | OnClick = Button1Click 40 | end 41 | object Memo1: TMemo 42 | Left = 1208 43 | Top = 39 44 | Width = 177 45 | Height = 522 46 | Lines.Strings = ( 47 | '') 48 | ScrollBars = ssBoth 49 | TabOrder = 1 50 | Visible = False 51 | WordWrap = False 52 | end 53 | object Edit1: TEdit 54 | Left = 573 55 | Top = 12 56 | Width = 121 57 | Height = 21 58 | TabOrder = 2 59 | Text = 'Edit1' 60 | Visible = False 61 | end 62 | object Edit2: TEdit 63 | Left = 700 64 | Top = 12 65 | Width = 121 66 | Height = 21 67 | TabOrder = 3 68 | Text = 'Edit2' 69 | Visible = False 70 | end 71 | object Button2: TButton 72 | Left = 827 73 | Top = 8 74 | Width = 110 75 | Height = 25 76 | Caption = 'Add To Firebase' 77 | TabOrder = 4 78 | Visible = False 79 | OnClick = Button2Click 80 | end 81 | object AddFile: TButton 82 | Left = 215 83 | Top = 8 84 | Width = 170 85 | Height = 25 86 | Caption = 'Add Document To Firebase' 87 | TabOrder = 5 88 | OnClick = AddFileClick 89 | end 90 | object Button3: TButton 91 | Left = 391 92 | Top = 8 93 | Width = 146 94 | Height = 25 95 | Caption = 'Delete All Documents' 96 | TabOrder = 6 97 | OnClick = Button3Click 98 | end 99 | object Memo2: TMemo 100 | Left = 1391 101 | Top = 39 102 | Width = 130 103 | Height = 522 104 | TabOrder = 7 105 | Visible = False 106 | end 107 | object Button4: TButton 108 | Left = 935 109 | Top = 8 110 | Width = 75 111 | Height = 25 112 | Caption = 'Parse' 113 | TabOrder = 8 114 | Visible = False 115 | OnClick = Button4Click 116 | end 117 | object ListBox1: TListBox 118 | Left = 8 119 | Top = 39 120 | Width = 201 121 | Height = 522 122 | ItemHeight = 13 123 | TabOrder = 9 124 | OnDblClick = ListBox1DblClick 125 | end 126 | object WebBrowser1: TWebBrowser 127 | Left = 215 128 | Top = 87 129 | Width = 795 130 | Height = 474 131 | TabOrder = 10 132 | ControlData = { 133 | 4C0000002A520000FD3000000000000000000000000000000000000000000000 134 | 000000004C000000000000000000000001000000E0D057007335CF11AE690800 135 | 2B2E12620C000000000000004C0000000114020000000000C000000000000046 136 | 8000000000000000000000000000000000000000000000000000000000000000 137 | 00000000000000000100000000000000000000000000000000000000} 138 | end 139 | object Button5: TButton 140 | Left = 496 141 | Top = 56 142 | Width = 75 143 | Height = 25 144 | Caption = 'Button5' 145 | TabOrder = 11 146 | OnClick = Button5Click 147 | end 148 | end 149 | object TabSheet2: TTabSheet 150 | Caption = 'FCM' 151 | ImageIndex = 1 152 | ExplicitWidth = 281 153 | ExplicitHeight = 165 154 | object Label1: TLabel 155 | Left = 48 156 | Top = 33 157 | Width = 29 158 | Height = 13 159 | Caption = 'Token' 160 | end 161 | object Label2: TLabel 162 | Left = 37 163 | Top = 6 164 | Width = 40 165 | Height = 13 166 | Caption = 'Api Key:' 167 | end 168 | object Edit3: TEdit 169 | Left = 83 170 | Top = 30 171 | Width = 310 172 | Height = 21 173 | TabOrder = 0 174 | Text = 'xxxxxxxxxxxxxxxxxxx' 175 | end 176 | object Button6: TButton 177 | Left = 83 178 | Top = 57 179 | Width = 118 180 | Height = 25 181 | Caption = 'Register Device' 182 | TabOrder = 1 183 | OnClick = Button6Click 184 | end 185 | object Edit4: TEdit 186 | Left = 83 187 | Top = 3 188 | Width = 310 189 | Height = 21 190 | TabOrder = 2 191 | Text = 'xxxxxxxxxxxxxxxxxxx' 192 | end 193 | object Memo3: TMemo 194 | Left = 83 195 | Top = 88 196 | Width = 630 197 | Height = 217 198 | TabOrder = 3 199 | end 200 | end 201 | end 202 | object OpenDialog1: TOpenDialog 203 | Left = 280 204 | Top = 376 205 | end 206 | end 207 | -------------------------------------------------------------------------------- /source/lib.options.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.options; 29 | 30 | interface 31 | 32 | uses 33 | System.classes, SysUtils; 34 | 35 | type 36 | IOptions = interface 37 | procedure SetAppId(const Value: string); 38 | procedure SetMasterSecret(const Value: string); 39 | function GetAppId() : string; 40 | function GetMasterSecret() : string; 41 | procedure SetCollection(const Value: string); 42 | function GetCollection() : string; 43 | function Load() : IOptions; 44 | function GetFirebaseAuth() : string; 45 | procedure SetFirebaseAuth(const Value : string); 46 | procedure SetCOCToken(const Value: string); 47 | function GetCOCToken() : string; 48 | property AppId : string read GetAppId write SetAppId; 49 | property MasterSecret : string read GetMasterSecret write SetMasterSecret; 50 | property Collection : string read GetCollection write SetCollection; 51 | property FirebaseAuth : string read GetFirebaseAuth write SetFirebaseAuth; 52 | property COCToken : string read GetCOCToken write SetCOCToken; 53 | end; 54 | 55 | TOptions = class(TInterfacedObject, IOptions) 56 | private 57 | FAppId: string; 58 | FMasterSecret: string; 59 | FCollection: string; 60 | FFirebaseAuth : string; 61 | FCOCToken: string; 62 | procedure SetAppId(const Value: string); 63 | procedure SetMasterSecret(const Value: string); 64 | function GetAppId() : string; 65 | function GetMasterSecret() : string; 66 | procedure SetCollection(const Value: string); 67 | function GetCollection() : string; 68 | function GetFirebaseAuth() : string; 69 | procedure SetFirebaseAuth(const Value : string); 70 | procedure SetCOCToken(const Value: string); 71 | function GetCOCToken() : string; 72 | public 73 | property AppId : string read GetAppId write SetAppId; 74 | property MasterSecret : string read GetMasterSecret write SetMasterSecret; 75 | property Collection : string read GetCollection write SetCollection; 76 | property FirebaseAuth : string read GetFirebaseAuth write SetFirebaseAuth; 77 | property COCToken : string read GetCOCToken write SetCOCToken; 78 | class function New(): IOptions; 79 | function Load() : IOptions; 80 | end; 81 | 82 | implementation 83 | 84 | uses 85 | inifiles; 86 | 87 | { TOptions } 88 | 89 | function TOptions.GetAppId: string; 90 | begin 91 | result := FAppId; 92 | end; 93 | 94 | function TOptions.GetCOCToken: string; 95 | begin 96 | result := FCOCToken; 97 | end; 98 | 99 | function TOptions.GetCollection: string; 100 | begin 101 | result := FCollection; 102 | end; 103 | 104 | function TOptions.GetFirebaseAuth: string; 105 | begin 106 | result := FFirebaseAuth; 107 | end; 108 | 109 | function TOptions.GetMasterSecret: string; 110 | begin 111 | result := FMasterSecret; 112 | end; 113 | 114 | function TOptions.Load : IOptions; 115 | var 116 | inifile : Tinifile; 117 | begin 118 | inifile := TInifile.Create(ExtractFilePath(ParamStr(0)) + 'urlManager.ini'); 119 | try 120 | FAppId := inifile.ReadString('Kinvey', 'AppId', ''); 121 | FMasterSecret := inifile.ReadString('Kinvey', 'MasterSecret', ''); 122 | FCollection := inifile.ReadString('Kinvey', 'Collection', ''); 123 | FFirebaseAuth := inifile.ReadString('Firebase', 'Auth', ''); 124 | FCOCToken := inifile.ReadString('COC', 'token', ''); 125 | finally 126 | inifile.Free; 127 | end; 128 | result := self; 129 | end; 130 | 131 | class function TOptions.New: IOptions; 132 | begin 133 | result := Create; 134 | end; 135 | 136 | procedure TOptions.SetAppId(const Value: string); 137 | begin 138 | FAppId := Value; 139 | end; 140 | 141 | procedure TOptions.SetCOCToken(const Value: string); 142 | begin 143 | FCOCToken := Value; 144 | end; 145 | 146 | procedure TOptions.SetCollection(const Value: string); 147 | begin 148 | FCollection := Value; 149 | end; 150 | 151 | procedure TOptions.SetFirebaseAuth(const Value: string); 152 | begin 153 | FFirebaseAuth := Value; 154 | end; 155 | 156 | procedure TOptions.SetMasterSecret(const Value: string); 157 | begin 158 | FMasterSecret := Value; 159 | end; 160 | 161 | end. 162 | -------------------------------------------------------------------------------- /source/lib.document.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.document; 29 | 30 | interface 31 | 32 | uses 33 | generics.collections; 34 | 35 | type 36 | IDocument = interface 37 | procedure SetDocument(const Value: string); 38 | procedure SetFileName(const Value: string); 39 | function GetDocument() : string; 40 | function GetFileName() : string; 41 | property FileName : string read GetFileName write SetFileName; 42 | property Document : string read GetDocument write SetDocument; 43 | procedure Save(); overload; 44 | procedure Save(path : string); overload; 45 | end; 46 | 47 | TDocument = class(TInterfacedObject, IDocument) 48 | private 49 | FFileName: string; 50 | FDocument: string; 51 | procedure SetDocument(const Value: string); 52 | procedure SetFileName(const Value: string); 53 | function GetDocument() : string; 54 | function GetFileName() : string; 55 | public 56 | property FileName : string read GetFileName write SetFileName; 57 | property Document : string read GetDocument write SetDocument; 58 | constructor Create(FileName : string; Document : string); 59 | class function New(FileName : string; Document : string): IDocument; 60 | procedure Save(); overload; 61 | procedure Save(path : string); overload; 62 | end; 63 | 64 | TDocumentParser = class(TObject) 65 | class function ParseRequestJSON(json : string) : TList; 66 | end; 67 | 68 | implementation 69 | 70 | uses 71 | System.Classes, System.JSON, Data.DBXJSONCommon, System.SysUtils, System.StrUtils; 72 | 73 | { TDocument } 74 | 75 | constructor TDocument.Create(FileName, Document: string); 76 | begin 77 | SetFileName(FileName); 78 | SetDocument(Document); 79 | end; 80 | 81 | function TDocument.GetDocument: string; 82 | begin 83 | result := FDocument; 84 | end; 85 | 86 | function TDocument.GetFileName: string; 87 | begin 88 | result := FFileName; 89 | end; 90 | 91 | class function TDocument.New(FileName : string; Document : string): IDocument; 92 | begin 93 | result := Create(FileName, Document); 94 | end; 95 | 96 | procedure TDocument.Save; 97 | var 98 | jsonArray : TJSONArray; 99 | fs: TFileStream; 100 | Stream : TStream; 101 | buf: TBytes; 102 | begin 103 | jsonArray := TJSONObject.ParseJSONValue(FDocument) as TJSONArray; 104 | fs := TFileStream.Create('c:\temp\' + FFileName, fmCreate); 105 | Stream := TDBXJSONTools.JSONToStream(jsonArray); 106 | try 107 | SetLength(buf, Stream.Size); 108 | Stream.Position := 0; 109 | Stream.ReadBuffer(buf[0], Stream.Size); 110 | fs.WriteBuffer(buf[0], Stream.Size); 111 | finally 112 | Stream.Free; 113 | fs.Free; 114 | end; 115 | end; 116 | 117 | procedure TDocument.Save(path : string); 118 | var 119 | jsonArray : TJSONArray; 120 | fs: TFileStream; 121 | Stream : TStream; 122 | buf: TBytes; 123 | begin 124 | jsonArray := TJSONObject.ParseJSONValue(FDocument) as TJSONArray; 125 | fs := TFileStream.Create(path + FFileName, fmCreate); 126 | Stream := TDBXJSONTools.JSONToStream(jsonArray); 127 | try 128 | SetLength(buf, Stream.Size); 129 | Stream.Position := 0; 130 | Stream.ReadBuffer(buf[0], Stream.Size); 131 | fs.WriteBuffer(buf[0], Stream.Size); 132 | finally 133 | Stream.Free; 134 | fs.Free; 135 | end; 136 | end; 137 | 138 | procedure TDocument.SetDocument(const Value: string); 139 | begin 140 | FDocument := Value; 141 | end; 142 | 143 | procedure TDocument.SetFileName(const Value: string); 144 | begin 145 | FFileName := Value; 146 | end; 147 | 148 | { TDocumentParser } 149 | 150 | class function TDocumentParser.ParseRequestJSON(json: string): TList; 151 | var 152 | s : string; 153 | i : integer; 154 | j, k : integer; 155 | doc : string; 156 | name : string; 157 | list : TList; 158 | begin 159 | list := TList.Create; 160 | s := json; 161 | i := 1; 162 | while i > 0 do 163 | begin 164 | i := AnsiPos('array', s); 165 | j := AnsiPos('document', s); 166 | if ((i > 0) and (j>0)) then 167 | begin 168 | doc := copy(s, i, j-i); 169 | doc := doc.Replace('array":', ''); 170 | doc := doc.Replace(',"', ''); 171 | name := AnsiRightStr(s, length(s)-j+1); 172 | k := AnsiPos('}', name); 173 | name := copy(name, 0, k); 174 | name := name.Replace('document":"', ''); 175 | name := name.Replace('"}', ''); 176 | s := AnsiRightStr(s, length(s)-(j+k)); 177 | list.Add(TDocument.New(name, doc)); 178 | end; 179 | end; 180 | result := list; 181 | end; 182 | 183 | end. 184 | -------------------------------------------------------------------------------- /source/frmUrlManagerMobile.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit frmUrlManagerMobile; 29 | 30 | interface 31 | 32 | uses 33 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 34 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, IPPeerClient, 35 | REST.Backend.ServiceTypes, REST.Backend.MetaTypes, System.JSON, 36 | REST.Backend.KinveyServices, Data.Bind.Components, Data.Bind.ObjectScope, 37 | REST.Backend.BindSource, REST.Backend.ServiceComponents, 38 | REST.Backend.KinveyProvider, FMX.ListView.Types, FMX.ListView.Appearances, 39 | FMX.ListView.Adapters.Base, FMX.ListView, REST.Backend.Providers, 40 | FMX.Controls.Presentation, FMX.StdCtrls, lib.urls, Generics.Collections, 41 | FMX.Edit, FMX.TabControl; 42 | 43 | type 44 | TForm2 = class(TForm) 45 | ListView1: TListView; 46 | btnRefresh: TButton; 47 | Label1: TLabel; 48 | Edit1: TEdit; 49 | TabControl1: TTabControl; 50 | tabCloud: TTabItem; 51 | tabDetails: TTabItem; 52 | Panel1: TPanel; 53 | Label2: TLabel; 54 | Edit2: TEdit; 55 | Label3: TLabel; 56 | Edit3: TEdit; 57 | btnAdd: TButton; 58 | lblUser: TLabel; 59 | lblPassword: TLabel; 60 | lblUrl: TLabel; 61 | BackendStorage1: TBackendStorage; 62 | KinveyProvider1: TKinveyProvider; 63 | BackendQuery1: TBackendQuery; 64 | procedure btnRefreshClick(Sender: TObject); 65 | procedure ListView1ItemClick(const Sender: TObject; const AItem: TListViewItem); 66 | procedure btnAddClick(Sender: TObject); 67 | procedure FormCreate(Sender: TObject); 68 | private 69 | FBackendList: TBackendObjectList; 70 | function CreateUrlsList(const AProviderID: string; const AStorage: TBackendStorageApi): TBackendObjectList; 71 | function GetCollection: TList; 72 | { Private declarations } 73 | public 74 | { Public declarations } 75 | end; 76 | 77 | var 78 | Form2: TForm2; 79 | 80 | implementation 81 | 82 | uses 83 | StrUtils; 84 | 85 | {$R *.fmx} 86 | {$R *.LgXhdpiTb.fmx ANDROID} 87 | {$R *.LgXhdpiPh.fmx ANDROID} 88 | 89 | function TForm2.GetCollection() : TList; 90 | var 91 | list: TList; 92 | url: TUrls; 93 | begin 94 | list := TList.Create; 95 | try 96 | FBackendList := CreateUrlsList(BackendStorage1.Provider.ProviderID, BackendStorage1.Storage); 97 | try 98 | for url in FBackendList do 99 | list.Add(url); 100 | except 101 | list.Free; 102 | raise; 103 | end; 104 | finally 105 | result := list; 106 | end; 107 | end; 108 | 109 | procedure TForm2.ListView1ItemClick(const Sender: TObject; const AItem: TListViewItem); 110 | begin 111 | lblUser.Text := 'User: ' + AItem.Text; 112 | lblPassword.Text := 'Password: ' + AnsiLeftStr(AItem.Detail, AnsiPos(',', AItem.Detail)-1); 113 | lblUrl.Text := 'Url: ' + AnsiRightStr(AItem.Detail, Length(AItem.Detail) - AnsiPos(',', AItem.Detail)); 114 | Self.TabControl1.ActiveTab := TabDetails; 115 | end; 116 | 117 | procedure TForm2.btnRefreshClick(Sender: TObject); 118 | var 119 | list : TList; 120 | listitem : TListViewItem; 121 | url : TUrls; 122 | begin 123 | list := GetCollection(); 124 | listview1.items.clear; 125 | for url in list do 126 | begin 127 | listitem := listview1.Items.Add; 128 | listItem.Text := url.User; 129 | listItem.Detail := url.Password + ',' + url.Url; 130 | end; 131 | end; 132 | 133 | procedure TForm2.btnAddClick(Sender: TObject); 134 | var 135 | url : TUrls; 136 | LEntity: TBackendEntityValue; 137 | begin 138 | url := TURls.Create(edit1.Text, edit2.Text, edit3.Text); 139 | try 140 | BackendStorage1.Storage.CreateObject('websites', url, LEntity); 141 | except 142 | showMessage('Error adding details'); 143 | raise; 144 | end; 145 | showMessage('Item has been successfully added!'); 146 | edit1.Text := ''; 147 | edit2.Text := ''; 148 | edit3.Text := ''; 149 | btnRefreshClick(sender); 150 | end; 151 | 152 | function TForm2.CreateUrlsList(const AProviderID: string; const AStorage: TBackendStorageApi): TBackendObjectList; 153 | var 154 | query: TArray; 155 | urlList: TBackendObjectList; 156 | begin 157 | urlList := TBackendObjectList.Create; 158 | try 159 | query := TArray.Create(Format('order=%s', ['user'])); 160 | AStorage.QueryObjects('websites', query, urlList); 161 | except 162 | urlList.Free; 163 | raise; 164 | end; 165 | Result := urlList; 166 | end; 167 | 168 | procedure TForm2.FormCreate(Sender: TObject); 169 | begin 170 | btnRefreshClick(sender); 171 | end; 172 | 173 | end. 174 | -------------------------------------------------------------------------------- /source/frmUrlManagerMobile.fmx: -------------------------------------------------------------------------------- 1 | object Form2: TForm2 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form2' 5 | ClientHeight = 619 6 | ClientWidth = 361 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | OnCreate = FormCreate 11 | DesignerMasterStyle = 0 12 | object btnRefresh: TButton 13 | Position.X = 184.000000000000000000 14 | Position.Y = 136.000000000000000000 15 | Size.Width = 161.000000000000000000 16 | Size.Height = 44.000000000000000000 17 | Size.PlatformDefault = False 18 | TabOrder = 4 19 | Text = 'Refresh' 20 | OnClick = btnRefreshClick 21 | end 22 | object Label1: TLabel 23 | Position.X = 16.000000000000000000 24 | Position.Y = 24.000000000000000000 25 | Text = 'User:' 26 | end 27 | object Edit1: TEdit 28 | Touch.InteractiveGestures = [LongTap, DoubleTap] 29 | TabOrder = 11 30 | Position.X = 112.000000000000000000 31 | Position.Y = 16.000000000000000000 32 | Size.Width = 233.000000000000000000 33 | Size.Height = 32.000000000000000000 34 | Size.PlatformDefault = False 35 | end 36 | object TabControl1: TTabControl 37 | Position.X = 16.000000000000000000 38 | Position.Y = 184.000000000000000000 39 | Size.Width = 329.000000000000000000 40 | Size.Height = 417.000000000000000000 41 | Size.PlatformDefault = False 42 | TabHeight = 49.000000000000000000 43 | TabIndex = 0 44 | TabOrder = 12 45 | TabPosition = PlatformDefault 46 | Sizes = ( 47 | 329s 48 | 368s 49 | 329s 50 | 368s) 51 | object tabCloud: TTabItem 52 | CustomIcon = < 53 | item 54 | end> 55 | IsSelected = True 56 | Size.Width = 78.000000000000000000 57 | Size.Height = 49.000000000000000000 58 | Size.PlatformDefault = False 59 | StyleLookup = '' 60 | TabOrder = 0 61 | Text = 'Cloud data' 62 | ExplicitSize.cx = 164.000000000000000000 63 | ExplicitSize.cy = 49.000000000000000000 64 | object ListView1: TListView 65 | ItemAppearanceClassName = 'TListItemAppearance' 66 | ItemEditAppearanceClassName = 'TListItemShowCheckAppearance' 67 | HeaderAppearanceClassName = 'TListHeaderObjects' 68 | FooterAppearanceClassName = 'TListHeaderObjects' 69 | Align = Client 70 | Size.Width = 329.000000000000000000 71 | Size.Height = 368.000000000000000000 72 | Size.PlatformDefault = False 73 | TabOrder = 0 74 | OnItemClick = ListView1ItemClick 75 | end 76 | end 77 | object tabDetails: TTabItem 78 | CustomIcon = < 79 | item 80 | end> 81 | IsSelected = False 82 | Size.Width = 56.000000000000000000 83 | Size.Height = 49.000000000000000000 84 | Size.PlatformDefault = False 85 | StyleLookup = '' 86 | TabOrder = 0 87 | Text = 'Details' 88 | ExplicitSize.cx = 165.000000000000000000 89 | ExplicitSize.cy = 49.000000000000000000 90 | object Panel1: TPanel 91 | Align = Client 92 | Size.Width = 329.000000000000000000 93 | Size.Height = 368.000000000000000000 94 | Size.PlatformDefault = False 95 | TabOrder = 0 96 | object lblUser: TLabel 97 | AutoSize = True 98 | Position.X = 24.000000000000000000 99 | Position.Y = 24.000000000000000000 100 | Size.Width = 37.000000000000000000 101 | Size.Height = 16.000000000000000000 102 | Size.PlatformDefault = False 103 | TextSettings.WordWrap = False 104 | Text = 'lblUser' 105 | end 106 | object lblPassword: TLabel 107 | AutoSize = True 108 | Position.X = 24.000000000000000000 109 | Position.Y = 72.000000000000000000 110 | Size.Width = 35.000000000000000000 111 | Size.Height = 16.000000000000000000 112 | Size.PlatformDefault = False 113 | TextSettings.WordWrap = False 114 | Text = 'Label4' 115 | end 116 | object lblUrl: TLabel 117 | AutoSize = True 118 | Position.X = 24.000000000000000000 119 | Position.Y = 120.000000000000000000 120 | Size.Width = 35.000000000000000000 121 | Size.Height = 16.000000000000000000 122 | Size.PlatformDefault = False 123 | TextSettings.WordWrap = False 124 | Text = 'Label4' 125 | end 126 | end 127 | end 128 | end 129 | object Label2: TLabel 130 | Position.X = 16.000000000000000000 131 | Position.Y = 64.000000000000000000 132 | Size.Width = 89.000000000000000000 133 | Size.Height = 23.000000000000000000 134 | Size.PlatformDefault = False 135 | Text = 'Password:' 136 | end 137 | object Edit2: TEdit 138 | Touch.InteractiveGestures = [LongTap, DoubleTap] 139 | TabOrder = 10 140 | Position.X = 112.000000000000000000 141 | Position.Y = 56.000000000000000000 142 | Size.Width = 233.000000000000000000 143 | Size.Height = 32.000000000000000000 144 | Size.PlatformDefault = False 145 | end 146 | object Label3: TLabel 147 | Position.X = 16.000000000000000000 148 | Position.Y = 104.000000000000000000 149 | Text = 'Url:' 150 | end 151 | object Edit3: TEdit 152 | Touch.InteractiveGestures = [LongTap, DoubleTap] 153 | TabOrder = 9 154 | Position.X = 112.000000000000000000 155 | Position.Y = 96.000000000000000000 156 | Size.Width = 233.000000000000000000 157 | Size.Height = 32.000000000000000000 158 | Size.PlatformDefault = False 159 | end 160 | object btnAdd: TButton 161 | Position.X = 16.000000000000000000 162 | Position.Y = 136.000000000000000000 163 | Size.Width = 161.000000000000000000 164 | Size.Height = 44.000000000000000000 165 | Size.PlatformDefault = False 166 | TabOrder = 3 167 | Text = 'Add' 168 | OnClick = btnAddClick 169 | end 170 | object BackendStorage1: TBackendStorage 171 | Provider = KinveyProvider1 172 | Left = 160 173 | Top = 336 174 | end 175 | object KinveyProvider1: TKinveyProvider 176 | ApiVersion = '3' 177 | AppKey = 'kid_HkaDuTFH' 178 | AppSecret = '78a3d240526d4440bdf5c9d68403a7dc' 179 | MasterSecret = '63162143962846459271516e26906ab8' 180 | Left = 160 181 | Top = 273 182 | end 183 | object BackendQuery1: TBackendQuery 184 | Provider = KinveyProvider1 185 | Left = 168 186 | Top = 409 187 | end 188 | end 189 | -------------------------------------------------------------------------------- /source/CloudMessaging.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit CloudMessaging; 29 | 30 | interface 31 | 32 | uses 33 | System.SysUtils, System.Types, System.UITypes, System.Classes, 34 | System.Variants, System.Notification, 35 | FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, 36 | FMX.Controls.Presentation, FMX.ActnList, FMX.TabControl, System.Actions, 37 | System.IOUtils, 38 | FMX.ScrollBox, FMX.Memo, System.PushNotification, lib.firebase.rest, 39 | IdSSLOpenSSLHeaders 40 | {$IFDEF ANDROID} 41 | , FMX.PushNotification.android 42 | {$ENDIF}; 43 | 44 | type 45 | TfrmMain = class(TForm) 46 | Header: TToolBar; 47 | Footer: TToolBar; 48 | HeaderLabel: TLabel; 49 | SpeedButton2: TSpeedButton; 50 | ActionList1: TActionList; 51 | TitleAction: TControlAction; 52 | PreviousTabAction1: TPreviousTabAction; 53 | NextTabAction1: TNextTabAction; 54 | ShowToken: TAction; 55 | Memo1: TMemo; 56 | SpeedButton1: TSpeedButton; 57 | RegisterDevice: TAction; 58 | StyleBook1: TStyleBook; 59 | procedure ShowTokenExecute(Sender: TObject); 60 | procedure RegisterDeviceExecute(Sender: TObject); 61 | procedure FormCreate(Sender: TObject); 62 | private 63 | procedure OnReceiveNotificationEvent(Sender: TObject; const ServiceNotification: TPushServiceNotification); 64 | procedure OnServiceConnectionChange(Sender: TObject; PushChanges: TPushService.TChanges); 65 | procedure ShowAndroidNotification(MessageText: string; NotificationNumber: integer); 66 | { Private declarations } 67 | public 68 | PushService: TPushService; 69 | ServiceConnection: TPushServiceConnection; 70 | DeviceId: string; 71 | DeviceToken: string; 72 | end; 73 | 74 | var 75 | frmMain: TfrmMain; 76 | 77 | implementation 78 | 79 | {$R *.fmx} 80 | 81 | procedure TfrmMain.FormCreate(Sender: TObject); 82 | begin 83 | IdOpenSSLSetLibPath(TPath.GetDocumentsPath); 84 | end; 85 | 86 | procedure TfrmMain.RegisterDeviceExecute(Sender: TObject); 87 | var 88 | response: string; 89 | begin 90 | // Register the device and get the token back 91 | response := TFirebaseRest.New.RegisterDeviceToken(DeviceToken, 'xxxx'); 92 | Memo1.Lines.Add(response); 93 | end; 94 | 95 | procedure TfrmMain.ShowTokenExecute(Sender: TObject); 96 | begin 97 | {$IFDEF ANDROID} 98 | PushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.GCM); 99 | PushService.AppProps[TPushService.TAppPropNames.GCMAppID] := '41271381247'; 100 | {$ENDIF} 101 | ServiceConnection := TPushServiceConnection.Create(PushService); 102 | ServiceConnection.Active := True; 103 | ServiceConnection.OnChange := OnServiceConnectionChange; 104 | ServiceConnection.OnReceiveNotification := OnReceiveNotificationEvent; 105 | 106 | DeviceId := PushService.DeviceIDValue[TPushService.TDeviceIDNames.DeviceId]; 107 | DeviceToken := PushService.DeviceTokenValue[TPushService.TDeviceTokenNames.DeviceToken]; 108 | Memo1.Lines.Add(DateTimeToStr(Now) + ' DeviceID: ' + DeviceId); 109 | Memo1.Lines.Add(DateTimeToStr(Now) + ' FCM Token: ' + DeviceToken); 110 | Memo1.Lines.Add(DateTimeToStr(Now) + ' Ready to receive!'); 111 | end; 112 | 113 | procedure TfrmMain.OnServiceConnectionChange(Sender: TObject; PushChanges: TPushService.TChanges); 114 | begin 115 | DeviceId := PushService.DeviceIDValue[TPushService.TDeviceIDNames.DeviceId]; 116 | DeviceToken := PushService.DeviceTokenValue[TPushService.TDeviceTokenNames.DeviceToken]; 117 | Memo1.Lines.Add(DateTimeToStr(Now) + ' DeviceID: ' + DeviceId); 118 | Memo1.Lines.Add(DateTimeToStr(Now) + ' FCM Token: ' + DeviceToken); 119 | end; 120 | 121 | procedure TfrmMain.OnReceiveNotificationEvent(Sender: TObject; const ServiceNotification: TPushServiceNotification); 122 | var 123 | MessageText: string; 124 | begin 125 | Memo1.Lines.Add(DateTimeToStr(Now) + ' DataKey = ' + ServiceNotification.DataKey); 126 | Memo1.Lines.Add(DateTimeToStr(Now) + ' Json = ' + ServiceNotification.Json.ToString); 127 | Memo1.Lines.Add(DateTimeToStr(Now) + ' DataObject = ' + ServiceNotification.DataObject.ToString); 128 | {$IFDEF ANDROID} 129 | MessageText := ServiceNotification.DataObject.GetValue('gcm.notification.body').Value; 130 | {$ENDIF}; 131 | Memo1.Lines.Add(DateTimeToStr(Now) + ' Message = ' + MessageText); 132 | ShowAndroidNotification(MessageText, 0); 133 | end; 134 | 135 | procedure TfrmMain.ShowAndroidNotification(MessageText: string; NotificationNumber: integer); 136 | var 137 | NotificationCenter: TNotificationCenter; 138 | Notification: TNotification; 139 | begin 140 | NotificationCenter := TNotificationCenter.Create(nil); 141 | try 142 | Notification := NotificationCenter.CreateNotification; 143 | try 144 | Notification.Name := MessageText; 145 | Notification.AlertBody := MessageText; 146 | Notification.Title := MessageText; 147 | Notification.EnableSound := false; 148 | Notification.Number := NotificationNumber; 149 | NotificationCenter.ApplicationIconBadgeNumber := NotificationNumber; 150 | NotificationCenter.PresentNotification(Notification); 151 | finally 152 | Notification.DisposeOf; 153 | end; 154 | finally 155 | NotificationCenter.Free; 156 | NotificationCenter.DisposeOf; 157 | end; 158 | end; 159 | 160 | end. 161 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BaaS Delphi Indy Samples over https 2 | 3 | [![Delphi version](https://img.shields.io/badge/delphi-Tokyo10.2-red.svg?style=plastic)](https://app.box.com/s/p7hwuaic1qsm14juf3pmuojv0ko98ok5) 4 | ![License](https://img.shields.io/badge/license-MIT-green.svg?style=plastic) 5 | 6 | ![](https://3.bp.blogspot.com/-_QZgeowOPYQ/V2xA5wUUHLI/AAAAAAAAFgQ/6Ca1guejVVw2U1s3EYi56bGkshge8b02ACLcB/s1600/mbaas.png) 7 | ![](https://3.bp.blogspot.com/-R9V-4Cq47sI/WDqsB6Lbk0I/AAAAAAAAF1Q/DQP6AkGaJxstXBpLLN-6jiVgU2AkkoXYgCLcB/s1600/firebasediagram.png) 8 | 9 | 10 | Code samples for **BaaS ([Kinvey](https://www.kinvey.com/))**, **BaaS ([Firebase](https://firebase.google.com/))** and **PaaS ([Parse.com](http://parse.com/))** using Delphi 10.2 Tokyo and [Indy Library](http://www.indyproject.org/index.en.aspx) 11 | -------------- 12 | **Related Articles:** 13 | - **Kinvey**: 14 | - [BaaS with Kinvey and Delphi 10.1 Berlin](http://thundaxsoftware.blogspot.co.uk/2016/06/baas-with-kinvey-and-delphi-101-berlin.html) 15 | - **Parse.com**: 16 | - [Sending REST API messages with Delphi to Parse.com](http://thundaxsoftware.blogspot.co.uk/2015/12/sending-rest-api-messages-with-delphi.html) 17 | - [Deploying Parse server to Heroku](http://thundaxsoftware.blogspot.co.uk/2016/05/deploying-parse-server-to-heroku.html) 18 | - [Creating your own self-hosted Parse server](http://thundaxsoftware.blogspot.co.uk/2016/05/creating-your-own-self-hosted-parse.html) 19 | - **Firebase**: 20 | - [Firebase file streaming with Delphi](http://thundaxsoftware.blogspot.co.uk/2016/11/firebase-file-streaming-with-delphi.html) 21 | - [Firebase Cloud Messaging with Delphi](http://thundaxsoftware.blogspot.co.uk/2017/01/firebase-cloud-messaging-with-delphi.html) - **Additional Notes**: 22 | Note that this has not been tested against any other version of Delphi and I have users that reported the issue with Firebase not returning the token. I will look into it soon and update the documentation. 23 | 24 | **Win64 example app using Kinvey** 25 | 26 | ![](https://4.bp.blogspot.com/-AsqDrk0ZnAA/V26CtdQr9FI/AAAAAAAAFhc/dMZrrIs3bJoGPVx2Vsc8nxt46i4W4pqcQCLcB/s640/vclExample.png) 27 | 28 | **Android example app using Kinvey** 29 | 30 | ![](https://3.bp.blogspot.com/-aYTpo_Q5MVc/V26ViH6L8FI/AAAAAAAAFiE/QNomSrfWic0ZEeTD8Na6IyzUOuWnzPC5gCLcB/s640/Screenshot_2016-06-25-14-47-29.png) 31 | 32 | **Data stored in Kinvey** 33 | 34 | ![](https://1.bp.blogspot.com/-q6DpnnASkCY/V2-a06zpAfI/AAAAAAAAFiU/6KLybvIw-KsJ9ewDYQIwYy9xUvUGRpFJgCLcB/s640/Kinvey7.png) 35 | 36 | These can be downloaded here: 37 | - https://github.com/JordiCorbilla/BaaSDelphiSamples/releases 38 | 39 | *Example usage Kinvey via Https:* 40 | ```Delphi 41 | function TKinveyRest.GetCollection: string; 42 | var 43 | IdHTTP: TIdHTTP; 44 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 45 | response : string; 46 | encodedHeader : string; 47 | begin 48 | try 49 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 50 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 51 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 52 | IdHTTP := TIdHTTP.Create(nil); 53 | try 54 | IdHTTP.IOHandler := IdIOHandler; 55 | IdHTTP.Request.Connection := 'Keep-Alive'; 56 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 57 | IdHTTP.Request.CustomHeaders.Clear; 58 | encodedHeader := TIdEncoderMIME.EncodeString(FOptions.AppId + ':' + FOptions.MasterSecret); 59 | IdHTTP.Request.CustomHeaders.Values['Authorization'] := 'Basic ' + encodedHeader; 60 | IdHTTP.Request.CustomHeaders.Values['X-Kinvey-API-Version'] := '3'; 61 | IdHTTP.Request.ContentType := 'application/json'; 62 | response := IdHTTP.Get('https://baas.kinvey.com/appdata/'+FOptions.AppId+'/'+FOptions.Collection+'/'); 63 | result := response; 64 | finally 65 | IdHTTP.Free; 66 | end; 67 | finally 68 | IdIOHandler.Free; 69 | end; 70 | end; 71 | ``` 72 | 73 | *Example usage Firebase via Https:* 74 | ```Delphi 75 | function TFirebaseRest.GetCollection: string; 76 | var 77 | IdHTTP: TIdHTTP; 78 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 79 | response : string; 80 | begin 81 | try 82 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 83 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 84 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 85 | IdHTTP := TIdHTTP.Create(nil); 86 | try 87 | IdHTTP.IOHandler := IdIOHandler; 88 | IdHTTP.ReadTimeout := IdTimeoutInfinite; 89 | IdHTTP.Request.Connection := 'Keep-Alive'; 90 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 91 | IdHTTP.Request.CustomHeaders.Clear; 92 | IdHTTP.Request.ContentType := 'application/json'; 93 | response := IdHTTP.Get('https://delphitestproject.firebaseio.com/.json?auth='+FOptions.FirebaseAuth); 94 | result := response; 95 | finally 96 | IdHTTP.Free; 97 | end; 98 | finally 99 | IdIOHandler.Free; 100 | end; 101 | end; 102 | ``` 103 | 104 | *Example usage Parse.com via Https:* 105 | ```Delphi 106 | procedure TParseRest.GetCollection: string; 107 | var 108 | response : string; 109 | JSONToSend: TStringStream; 110 | begin 111 | JSONToSend := TStringStream.Create('{}'); 112 | IdHTTP1.Request.Connection := 'Keep-Alive'; 113 | IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvSSLv23; 114 | IdHTTP1.Request.CustomHeaders.Clear; 115 | IdHTTP1.Request.CustomHeaders.Values['X-Parse-Application-Id'] := 'yourAppId'; 116 | IdHTTP1.Request.CustomHeaders.Values['X-Parse-REST-API-Key'] := 'yourRESTAPIKey'; 117 | IdHTTP1.Request.ContentType := 'application/json'; 118 | response := IdHttp1.Post('https://api.parse.com/1/events/AppOpened', JSONToSend); 119 | result := response; 120 | end; 121 | ``` 122 | 123 | **Licence** 124 | ------- 125 | 126 | The MIT License (MIT) 127 | 128 | Copyright (c) 2017 Jordi Corbilla 129 | 130 | Permission is hereby granted, free of charge, to any person obtaining a copy 131 | of this software and associated documentation files (the "Software"), to deal 132 | in the Software without restriction, including without limitation the rights 133 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 134 | copies of the Software, and to permit persons to whom the Software is 135 | furnished to do so, subject to the following conditions: 136 | 137 | The above copyright notice and this permission notice shall be included in 138 | all copies or substantial portions of the Software. 139 | 140 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 141 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 142 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 143 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 144 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 145 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 146 | THE SOFTWARE. 147 | -------------------------------------------------------------------------------- /source/lib.firebase.rest.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit lib.firebase.rest; 29 | 30 | interface 31 | 32 | uses 33 | IdHTTP, IdIOHandler, IdIOHandlerStream, 34 | IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdGlobal, 35 | System.SysUtils, System.Variants, System.Classes, lib.options, 36 | IdSSLOpenSSLHeaders_Static, System.IOUtils; 37 | 38 | type 39 | IFirebaseRest = interface 40 | function Add(jsonString: string) : boolean; 41 | function GetCollection() : string; 42 | function Delete() : boolean; 43 | function RegisterDeviceToken(token: string; apiKey : string) : string; 44 | end; 45 | 46 | TFirebaseRest = class(TInterfacedObject, IFirebaseRest) 47 | private 48 | FOptions : IOptions; 49 | public 50 | function Add(jsonString: string) : boolean; 51 | function GetCollection() : string; 52 | function Delete() : boolean; 53 | constructor Create(); 54 | function RegisterDeviceToken(token: string; apiKey : string) : string; 55 | class function New() : IFirebaseRest; 56 | end; 57 | 58 | implementation 59 | 60 | uses 61 | IdCoderMIME; 62 | 63 | { TFirebaseRest } 64 | 65 | function TFirebaseRest.Add(jsonString: string): boolean; 66 | var 67 | IdHTTP: TIdHTTP; 68 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 69 | response : string; 70 | JsonToSend: TStringStream; 71 | begin 72 | JsonToSend := TStringStream.Create(jsonString); 73 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 74 | try 75 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 76 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 77 | IdHTTP := TIdHTTP.Create(nil); 78 | try 79 | // IdHTTP.ReadTimeout := 30000; 80 | // IdHTTP.HandleRedirects := True; 81 | IdHTTP.IOHandler := IdIOHandler; 82 | IdHTTP.Request.Connection := 'Keep-Alive'; 83 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 84 | IdHTTP.Request.CustomHeaders.Clear; 85 | IdHTTP.Request.ContentType := 'application/json'; 86 | response := IdHTTP.Post('https://delphitestproject.firebaseio.com/.json?auth='+FOptions.FirebaseAuth, JsonToSend); 87 | response := response.Replace(Char(#10), ''); 88 | result := (response.Contains('name')); 89 | finally 90 | IdHTTP.Free; 91 | end; 92 | finally 93 | IdIOHandler.Free; 94 | JsonToSend.Free; 95 | end; 96 | end; 97 | 98 | constructor TFirebaseRest.Create; 99 | begin 100 | {$IFDEF ANDROID} 101 | FOptions := TOptions.Create; 102 | FOptions.FirebaseAuth := '7NZu878Wr56kWm4dSnVIoX52nd02zIRFsoGs7O1y'; 103 | {$ELSE} 104 | FOptions := TOptions.New.Load; 105 | {$ENDIF} 106 | end; 107 | 108 | function TFirebaseRest.Delete: boolean; 109 | var 110 | IdHTTP: TIdHTTP; 111 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 112 | response : string; 113 | JsonToSend: TStringStream; 114 | begin 115 | JsonToSend := TStringStream.Create(''); 116 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 117 | try 118 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 119 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 120 | IdHTTP := TIdHTTP.Create(nil); 121 | try 122 | // IdHTTP.ReadTimeout := 30000; 123 | // IdHTTP.HandleRedirects := True; 124 | IdHTTP.IOHandler := IdIOHandler; 125 | IdHTTP.Request.Connection := 'Keep-Alive'; 126 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 127 | IdHTTP.Request.CustomHeaders.Clear; 128 | IdHTTP.Request.ContentType := 'application/json'; 129 | IdHTTP.Delete('https://delphitestproject.firebaseio.com/.json?auth='+FOptions.FirebaseAuth, JsonToSend); 130 | response := response.Replace(Char(#10), ''); 131 | result := (response.Contains('name')); 132 | finally 133 | IdHTTP.Free; 134 | end; 135 | finally 136 | IdIOHandler.Free; 137 | JsonToSend.Free; 138 | end; 139 | end; 140 | 141 | //Sample using curl 142 | //curl --cacert ca-bundle.crt -X GET -H 'Content-Type: application/json' "https://delphitestproject.firebaseio.com/.json?auth=7NZu878Wr56kWm4dSnVIoX52nd02zIRFsoGs7O1y" 143 | //curl: (6) Could not resolve host: application 144 | //{"Process":"Windows"} 145 | 146 | function TFirebaseRest.GetCollection: string; 147 | var 148 | IdHTTP: TIdHTTP; 149 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 150 | response : string; 151 | begin 152 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 153 | try 154 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 155 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 156 | IdHTTP := TIdHTTP.Create(nil); 157 | try 158 | // IdHTTP.ReadTimeout := 30000; 159 | // IdHTTP.HandleRedirects := True; 160 | IdHTTP.IOHandler := IdIOHandler; 161 | IdHTTP.ReadTimeout := IdTimeoutInfinite; 162 | IdHTTP.Request.Connection := 'Keep-Alive'; 163 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 164 | IdHTTP.Request.CustomHeaders.Clear; 165 | IdHTTP.Request.ContentType := 'application/json'; 166 | response := IdHTTP.Get('https://delphitestproject.firebaseio.com/.json?auth='+FOptions.FirebaseAuth); 167 | result := response; 168 | finally 169 | IdHTTP.Free; 170 | end; 171 | finally 172 | IdIOHandler.Free; 173 | end; 174 | end; 175 | 176 | class function TFirebaseRest.New: IFirebaseRest; 177 | begin 178 | result := Create; 179 | end; 180 | 181 | //Register device token example: https://developers.google.com/instance-id/reference/server 182 | //https://iid.googleapis.com/iid/v1:batchImport 183 | //{ 184 | // "application": "com.google.FCMTestApp", 185 | // "sandbox":false, 186 | // "apns_tokens":[ 187 | // "368dde283db539abc4a6419b1795b6131194703b816e4f624ffa12", 188 | // "76b39c2b2ceaadee8400b8868c2f45325ab9831c1998ed70859d86" 189 | // ] 190 | // } 191 | //} 192 | function TFirebaseRest.RegisterDeviceToken(token, apiKey: string): string; 193 | var 194 | IdHTTP: TIdHTTP; 195 | IdIOHandler: TIdSSLIOHandlerSocketOpenSSL; 196 | response : string; 197 | jsonString : string; 198 | JsonToSend: TStringStream; 199 | begin 200 | IdIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); 201 | try 202 | IdIOHandler.ReadTimeout := IdTimeoutInfinite; 203 | IdIOHandler.ConnectTimeout := IdTimeoutInfinite; 204 | IdHTTP := TIdHTTP.Create(nil); 205 | try 206 | IdHTTP.IOHandler := IdIOHandler; 207 | IdHTTP.ReadTimeout := IdTimeoutInfinite; 208 | IdHTTP.Request.Connection := 'Keep-Alive'; 209 | IdIOHandler.SSLOptions.Method := sslvSSLv23; 210 | IdHTTP.Request.CustomHeaders.Clear; 211 | IdHTTP.Request.CustomHeaders.Values['Authorization:key'] := apiKey; 212 | IdHTTP.Request.ContentType := 'application/json'; 213 | jsonString := '{"application" : "com.embarcadero.FirebaseCloudMessaging", "sandbox":false, "apns_tokens" : ["'+token+'"]}'; 214 | JsonToSend := TStringStream.Create(jsonString); 215 | response := IdHTTP.Post('https://iid.googleapis.com/iid/v1:batchImport', JsonToSend); 216 | response := response.Replace(Char(#10), ''); 217 | result := response; 218 | finally 219 | IdHTTP.Free; 220 | end; 221 | finally 222 | IdIOHandler.Free; 223 | end; 224 | end; 225 | 226 | end. 227 | -------------------------------------------------------------------------------- /source/frmMain.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit frmMain; 29 | 30 | interface 31 | 32 | uses 33 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 34 | FMX.Types, FMX.Controls, FMX.Graphics, FMX.Forms, FMX.Dialogs, FMX.TabControl, System.Actions, FMX.ActnList, 35 | FMX.Objects, FMX.StdCtrls, FMX.Controls.Presentation, FMX.ListView.Types, 36 | FMX.ListView.Appearances, FMX.ListView.Adapters.Base, FMX.ListView, 37 | lib.firebase.rest, DBXJSON, System.JSON, Data.DBXJSONCommon, lib.document, generics.collections, 38 | FMX.Layouts, FMX.ListBox, FMX.WebBrowser, FMX.Ani, FMX.ScrollBox, FMX.Memo; 39 | 40 | type 41 | Tmain = class(TForm) 42 | ActionList1: TActionList; 43 | PreviousTabAction1: TPreviousTabAction; 44 | TitleAction: TControlAction; 45 | NextTabAction1: TNextTabAction; 46 | TopToolBar: TToolBar; 47 | ToolBarLabel: TLabel; 48 | BottomToolBar: TToolBar; 49 | Refresh: TAction; 50 | SpeedButton1: TSpeedButton; 51 | ListBox1: TListBox; 52 | SpeedButton2: TSpeedButton; 53 | Upload: TAction; 54 | AniIndicator2: TAniIndicator; 55 | FloatAnimation2: TFloatAnimation; 56 | OpenDialog1: TOpenDialog; 57 | Panel1: TPanel; 58 | Label1: TLabel; 59 | Button1: TButton; 60 | Memo1: TMemo; 61 | procedure RefreshExecute(Sender: TObject); 62 | procedure ListBoxItem1Click(Sender: TObject); 63 | procedure UploadExecute(Sender: TObject); 64 | procedure Button1Click(Sender: TObject); 65 | procedure FormCreate(Sender: TObject); 66 | private 67 | public 68 | end; 69 | 70 | var 71 | main: Tmain; 72 | 73 | implementation 74 | 75 | uses 76 | StrUtils, IdSSLOpenSSLHeaders, 77 | 78 | {$IFDEF ANDROID} 79 | Androidapi.JNI.GraphicsContentViewText, 80 | Androidapi.Helpers, 81 | Androidapi.JNI.JavaTypes, 82 | Androidapi.JNI.Net, 83 | {$ENDIF} 84 | System.IOUtils, System.Threading; 85 | 86 | {$R *.fmx} 87 | {$R *.LgXhdpiPh.fmx ANDROID} 88 | {$R *.iPhone4in.fmx IOS} 89 | 90 | procedure Tmain.RefreshExecute(Sender: TObject); 91 | begin 92 | //Load files from the cloud 93 | TTask.Create( 94 | procedure 95 | var 96 | return : string; 97 | List : TList; 98 | begin 99 | TThread.Synchronize(nil, 100 | procedure 101 | begin 102 | AniIndicator2.Enabled := true; 103 | AniIndicator2.Visible := true; 104 | Panel1.Visible := true; 105 | end 106 | ); 107 | 108 | try 109 | try 110 | return := TFirebaseRest.New.GetCollection; 111 | except 112 | on E : Exception do 113 | TThread.Synchronize(nil, 114 | procedure 115 | begin 116 | memo1.Visible := true; 117 | memo1.lines.clear; 118 | memo1.lines.add(E.Message); 119 | end 120 | ); 121 | end; 122 | 123 | Finally 124 | List := TDocumentParser.ParseRequestJSON(return); 125 | TThread.Synchronize(nil, 126 | procedure 127 | var 128 | i: Integer; 129 | ListBoxItem : TListBoxItem; 130 | begin 131 | ListBox1.BeginUpdate; 132 | Listbox1.Clear; 133 | for i := 0 to list.Count-1 do 134 | begin 135 | ListBoxItem := TListBoxItem.Create(ListBox1); 136 | ListBoxItem.Text := list[i].FileName; 137 | ListBoxItem.Data := TDocument(list[i]); 138 | ListBoxItem.ItemData.Accessory := TListBoxItemData.TAccessory(1); 139 | ListBoxItem.OnClick := ListBoxItem1Click; 140 | ListBox1.AddObject(ListBoxItem); 141 | end; 142 | ListBox1.EndUpdate; 143 | end 144 | ); 145 | end; 146 | 147 | TThread.Synchronize(nil, 148 | procedure 149 | begin 150 | AniIndicator2.Enabled := false; 151 | AniIndicator2.Visible := false; 152 | Panel1.Visible := false; 153 | end 154 | ); 155 | end 156 | ).Start; 157 | end; 158 | 159 | procedure Tmain.UploadExecute(Sender: TObject); 160 | var 161 | filename : string; 162 | begin 163 | OpenDialog1.InitialDir := TPath.GetSharedDownloadsPath; 164 | 165 | // Only allow existing files to be selected 166 | //OpenDialog1.Options := [ofFileMustExist]; 167 | 168 | // Allow only .dpr and .pas files to be selected 169 | OpenDialog1.Filter := 'PDF Files|*.pdf|MS Word|*.docx'; 170 | 171 | // Select pascal files as the starting filter type 172 | //OpenDialog1.FilterIndex := 2; 173 | 174 | // Display the open file dialog 175 | if OpenDialog1.Execute then 176 | begin 177 | filename := OpenDialog1.FileName; 178 | // Free up the dialog 179 | OpenDialog1.Free; 180 | 181 | TTask.Create( 182 | procedure 183 | var 184 | strFileStream: TFileStream; 185 | arr : TJSONArray; 186 | envelope : string; 187 | ByteArray: array of Byte; 188 | begin 189 | TThread.Synchronize(nil, 190 | procedure 191 | begin 192 | AniIndicator2.Enabled := true; 193 | AniIndicator2.Visible := true; 194 | Panel1.Visible := true; 195 | end 196 | ); 197 | 198 | try 199 | strFileStream := TFileStream.Create(filename, fmOpenRead); 200 | arr := TDBXJSONTools.StreamToJSON(strFileStream, 0, strFileStream.Size); 201 | strFileStream.Position := 0; 202 | SetLength(ByteArray, strFileStream.Size); 203 | strFileStream.Read(ByteArray[0], strFileStream.Size); 204 | strFileStream.Free; 205 | envelope := '{"document":"'+extractfilename(filename)+'","array":'+arr.toJSON+'}'; 206 | TFirebaseRest.New.Add(envelope); 207 | Finally 208 | TThread.Synchronize(nil, 209 | procedure 210 | begin 211 | ShowMessage('File uploaded successfully!'); 212 | end 213 | ); 214 | 215 | end; 216 | 217 | TThread.Synchronize(nil, 218 | procedure 219 | begin 220 | AniIndicator2.Enabled := false; 221 | AniIndicator2.Visible := false; 222 | Panel1.Visible := false; 223 | end 224 | ); 225 | end 226 | ).Start; 227 | 228 | end 229 | else 230 | begin 231 | ShowMessage('Open file was cancelled'); 232 | end; 233 | 234 | 235 | end; 236 | 237 | procedure Tmain.Button1Click(Sender: TObject); 238 | begin 239 | ShowMessage(TPath.GetDocumentsPath); 240 | end; 241 | 242 | procedure Tmain.FormCreate(Sender: TObject); 243 | begin 244 | IdOpenSSLSetLibPath(TPath.GetDocumentsPath); 245 | memo1.Lines.Clear; 246 | memo1.Visible := false; 247 | end; 248 | 249 | procedure Tmain.ListBoxItem1Click(Sender: TObject); 250 | var 251 | fName : String; 252 | document : TDocument; 253 | item : TListBoxItem; 254 | {$IFDEF ANDROID} 255 | Intent : JIntent; 256 | URI : Jnet_Uri; 257 | {$ENDIF} 258 | begin 259 | item := (Sender as TListBoxItem); 260 | item.IsSelected := true; 261 | //Save the document to the device 262 | document := (item.Data as TDocument); 263 | document.Save(TPath.GetSharedDownloadsPath + PathDelim); 264 | fName := TPath.Combine(TPath.GetSharedDownloadsPath, document.FileName); 265 | //IF Android, then call the open file 266 | {$IFDEF ANDROID} 267 | URI := TJnet_Uri.JavaClass.parse(StringToJString('file:///' + fName)); 268 | intent := TJIntent.Create; 269 | intent.setAction(TJIntent.JavaClass.ACTION_VIEW); 270 | intent.setDataAndType(URI,StringToJString('application/pdf')); 271 | SharedActivity.startActivity(intent); 272 | {$ENDIF} 273 | end; 274 | 275 | end. 276 | -------------------------------------------------------------------------------- /source/uFormTest.pas: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Jordi Corbilla 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // - Neither the name of this library nor the names of its contributors may be 13 | // used to endorse or promote products derived from this software without 14 | // specific prior written permission. 15 | // 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | // POSSIBILITY OF SUCH DAMAGE. 27 | 28 | unit uFormTest; 29 | 30 | interface 31 | 32 | uses 33 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 34 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, lib.firebase.rest, DBXJSON, 35 | System.JSON, Data.DBXJSONCommon, lib.document, generics.collections, 36 | Vcl.OleCtrls, SHDocVw, Vcl.ComCtrls; 37 | 38 | type 39 | TForm3 = class(TForm) 40 | PageControl1: TPageControl; 41 | TabSheet1: TTabSheet; 42 | TabSheet2: TTabSheet; 43 | Button1: TButton; 44 | Memo1: TMemo; 45 | Edit1: TEdit; 46 | Edit2: TEdit; 47 | Button2: TButton; 48 | AddFile: TButton; 49 | Button3: TButton; 50 | Memo2: TMemo; 51 | Button4: TButton; 52 | ListBox1: TListBox; 53 | WebBrowser1: TWebBrowser; 54 | Button5: TButton; 55 | OpenDialog1: TOpenDialog; 56 | Edit3: TEdit; 57 | Label1: TLabel; 58 | Button6: TButton; 59 | Edit4: TEdit; 60 | Label2: TLabel; 61 | Memo3: TMemo; 62 | procedure Button1Click(Sender: TObject); 63 | procedure Button2Click(Sender: TObject); 64 | procedure AddFileClick(Sender: TObject); 65 | procedure Button3Click(Sender: TObject); 66 | procedure Button4Click(Sender: TObject); 67 | procedure ListBox1DblClick(Sender: TObject); 68 | procedure Button5Click(Sender: TObject); 69 | procedure Button6Click(Sender: TObject); 70 | private 71 | function LoadDocuments(jsonString: string): TList; 72 | { Private declarations } 73 | public 74 | { Public declarations } 75 | end; 76 | 77 | var 78 | Form3: TForm3; 79 | 80 | implementation 81 | 82 | uses 83 | NetEncoding, IdCoderMIME, IdHash, IdHMAC, IdHMACSHA1, IdGlobal, StrUtils; 84 | 85 | {$R *.dfm} 86 | 87 | procedure TForm3.AddFileClick(Sender: TObject); 88 | var 89 | strFileStream: TFileStream; 90 | arr : TJSONArray; 91 | s : string; 92 | ByteArray: array of Byte; 93 | begin 94 | OpenDialog1.InitialDir := GetCurrentDir; 95 | 96 | // Only allow existing files to be selected 97 | OpenDialog1.Options := [ofFileMustExist]; 98 | 99 | // Allow only .dpr and .pas files to be selected 100 | OpenDialog1.Filter := 101 | 'PDF Files|*.pdf|MS Word|*.docx'; 102 | 103 | // Select pascal files as the starting filter type 104 | //OpenDialog1.FilterIndex := 2; 105 | 106 | // Display the open file dialog 107 | if OpenDialog1.Execute then 108 | begin 109 | //ShowMessage('File : '+OpenDialog1.FileName); 110 | strFileStream := TFileStream.Create(OpenDialog1.FileName, fmOpenRead); 111 | arr := TDBXJSONTools.StreamToJSON(strFileStream, 0, strFileStream.Size); 112 | 113 | strFileStream.Position := 0; 114 | SetLength(ByteArray, strFileStream.Size); 115 | strFileStream.Read(ByteArray[0], strFileStream.Size); 116 | strFileStream.Free; 117 | 118 | //s := String(TNetEncoding.URL.EncodeBytesToString(TIdEncoderMIME.EncodeBytes(IndyTextEncoding_UTF8.GetBytes(ByteArray)))); 119 | s := '{"document":"'+extractfilename(OpenDialog1.FileName)+'","array":'+arr.toJSON+'}'; 120 | TFirebaseRest.New.Add(s); 121 | 122 | //arr. 123 | end 124 | else 125 | begin 126 | ShowMessage('Open file was cancelled'); 127 | end; 128 | 129 | // Free up the dialog 130 | OpenDialog1.Free; 131 | end; 132 | 133 | procedure TForm3.Button1Click(Sender: TObject); 134 | var 135 | firebase : string; 136 | List : TList; 137 | i: Integer; 138 | begin 139 | firebase := TFirebaseRest.New.GetCollection; 140 | List := LoadDocuments(firebase); 141 | //Memo1.Lines.Add(firebase); 142 | 143 | for i := 0 to list.Count-1 do 144 | begin 145 | listbox1.AddItem(list[i].FileName, TDocument(list[i])); 146 | end; 147 | 148 | 149 | end; 150 | 151 | procedure TForm3.Button2Click(Sender: TObject); 152 | var 153 | jsonString : string; 154 | begin 155 | jsonString := '{"param1":"'+Edit1.text+'","value":"'+Edit2.text+'"}'; 156 | if TFirebaseRest.New.Add(jsonString) then 157 | begin 158 | showMessage('Item has been successfully added!'); 159 | end 160 | else 161 | showMessage('There was an error adding the data to the cloud storage'); 162 | end; 163 | 164 | procedure TForm3.Button3Click(Sender: TObject); 165 | begin 166 | TFirebaseRest.New.Delete(); 167 | end; 168 | 169 | procedure TForm3.ListBox1DblClick(Sender: TObject); 170 | var 171 | document : TDOcument; 172 | begin 173 | if (ListBox1.ItemIndex >= 0) then 174 | begin 175 | WebBrowser1.Navigate2('about:blank'); 176 | sleep(2000); 177 | Application.ProcessMessages; 178 | document := (listBox1.Items.Objects[ListBox1.ItemIndex] as TDocument); 179 | document.Save; 180 | WebBrowser1.Navigate2('file://c:/temp/' + document.FileName); 181 | end; 182 | end; 183 | 184 | function TForm3.LoadDocuments(jsonString : string) : TList; 185 | var 186 | s : string; 187 | i : integer; 188 | j, k : integer; 189 | doc : string; 190 | name : string; 191 | list : TList; 192 | begin 193 | list := TList.Create; 194 | s := jsonString; 195 | i := 1; 196 | while i > 0 do 197 | begin 198 | i := AnsiPos('array', s); 199 | j := AnsiPos('document', s); 200 | if ((i > 0) and (j>0)) then 201 | begin 202 | doc := copy(s, i, j-i); 203 | doc := doc.Replace('array":', ''); 204 | doc := doc.Replace(',"', ''); 205 | name := AnsiRightStr(s, length(s)-j+1); 206 | k := AnsiPos('}', name); 207 | name := copy(name, 0, k); 208 | name := name.Replace('document":"', ''); 209 | name := name.Replace('"}', ''); 210 | s := AnsiRightStr(s, length(s)-(j+k)); 211 | list.Add(TDocument.New(name, doc)); 212 | end; 213 | end; 214 | result := list; 215 | end; 216 | 217 | procedure TForm3.Button4Click(Sender: TObject); 218 | var 219 | s : string; 220 | i : integer; 221 | j, k : integer; 222 | doc : string; 223 | name : string; 224 | jsonArray : TJSONArray; 225 | fs: TFileStream; 226 | Stream : TStream; 227 | buf: TBytes; 228 | begin 229 | //Parse the following string 230 | //{"-KUmo1JUUAVTRAiZVXKd":{"array":[37,80],"document":"TESTING FIREBASE.pdf"}} 231 | s := '{"-KUmo1JUUAVTRAiZVXKd":{"array":[37,80],"document":"TESTING FIREBASE.pdf"},"-KUmo1JUUAVTRAiZVXKd":{"array":[37,80],"document":"TESTING FIREBASE.pdf"}}'; //memo1.Lines.ToString; 232 | s := memo1.Lines.Text; 233 | 234 | i := 1; 235 | while i > 0 do 236 | begin 237 | i := AnsiPos('array', s); 238 | j := AnsiPos('document', s); 239 | if ((i > 0) and (j>0)) then 240 | begin 241 | doc := copy(s, i, j-i); 242 | //array":[37,80]," 243 | doc := doc.Replace('array":', ''); 244 | doc := doc.Replace(',"', ''); 245 | memo2.Lines.Add(doc); 246 | 247 | name := AnsiRightStr(s, length(s)-j+1); 248 | k := AnsiPos('}', name); 249 | name := copy(name, 0, k); 250 | name := name.Replace('document":"', ''); 251 | name := name.Replace('"}', ''); 252 | memo2.Lines.Add(name); 253 | s := AnsiRightStr(s, length(s)-(j+k)); 254 | //document":"TESTING FIREBASE.pdf"} 255 | end; 256 | end; 257 | 258 | jsonArray := TJSONObject.ParseJSONValue(doc) as TJSONArray; 259 | 260 | fs := TFileStream.Create('c:\temp\' + name, fmCreate); 261 | Stream := TDBXJSONTools.JSONToStream(jsonArray); 262 | SetLength(buf, Stream.Size); 263 | Stream.Position := 0; 264 | Stream.ReadBuffer(buf[0], Stream.Size); 265 | fs.WriteBuffer(buf[0], Stream.Size); 266 | Stream.Free; 267 | fs.Free; 268 | end; 269 | 270 | procedure TForm3.Button5Click(Sender: TObject); 271 | begin 272 | WebBrowser1.Navigate2('file://c:/temp/TESTING FIREBASE 2.pdf'); 273 | // WebBrowser1.Navigate('www.google.co.uk'); 274 | end; 275 | 276 | procedure TForm3.Button6Click(Sender: TObject); 277 | var 278 | firebase : IFirebaseRest; 279 | result : string; 280 | begin 281 | TThread.Synchronize(TThread.CurrentThread, procedure 282 | begin 283 | firebase := TFirebaseRest.New; 284 | try 285 | result := firebase.RegisterDeviceToken(edit3.Text, edit4.text); 286 | memo3.Lines.Add(result); 287 | finally 288 | 289 | end; 290 | end); 291 | end; 292 | 293 | end. 294 | -------------------------------------------------------------------------------- /source/urlManagerMobile.deployproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 5 | 6 | 7 | 8 | urlManagerMobile\ 9 | urlManagerMobile.exe 10 | ProjectOutput 11 | 0 12 | 13 | 14 | True 15 | True 16 | 17 | 18 | 19 | 20 | urlManagerMobile\ 21 | urlManagerMobile.exe 22 | ProjectOutput 23 | 0 24 | 25 | 26 | True 27 | True 28 | 29 | 30 | 31 | 32 | urlManagerMobile\classes\ 33 | classes.dex 34 | AndroidClassesDexFile 35 | 1 36 | 37 | 38 | True 39 | 40 | 41 | urlManagerMobile\res\drawable-ldpi\ 42 | ic_launcher.png 43 | Android_LauncherIcon36 44 | 1 45 | 46 | 47 | True 48 | 49 | 50 | urlManagerMobile\library\lib\armeabi-v7a\ 51 | liburlManagerMobile.so 52 | ProjectOutput 53 | 1 54 | 55 | 56 | True 57 | True 58 | 59 | 60 | urlManagerMobile\ 61 | AndroidManifest.xml 62 | ProjectAndroidManifest 63 | 1 64 | 65 | 66 | True 67 | 68 | 69 | urlManagerMobile\library\lib\armeabi\ 70 | liburlManagerMobile.so 71 | AndroidLibnativeArmeabiFile 72 | 1 73 | 74 | 75 | True 76 | 77 | 78 | urlManagerMobile\res\drawable-hdpi\ 79 | ic_launcher.png 80 | Android_LauncherIcon72 81 | 1 82 | 83 | 84 | True 85 | 86 | 87 | urlManagerMobile\res\drawable-xxhdpi\ 88 | ic_launcher.png 89 | Android_LauncherIcon144 90 | 1 91 | 92 | 93 | True 94 | 95 | 96 | urlManagerMobile\res\drawable-xlarge\ 97 | splash_image.png 98 | Android_SplashImage960 99 | 1 100 | 101 | 102 | True 103 | 104 | 105 | urlManagerMobile\res\drawable-normal\ 106 | splash_image.png 107 | Android_SplashImage470 108 | 1 109 | 110 | 111 | True 112 | 113 | 114 | urlManagerMobile\res\drawable-large\ 115 | splash_image.png 116 | Android_SplashImage640 117 | 1 118 | 119 | 120 | True 121 | 122 | 123 | urlManagerMobile\res\drawable-small\ 124 | splash_image.png 125 | Android_SplashImage426 126 | 1 127 | 128 | 129 | True 130 | 131 | 132 | urlManagerMobile\res\drawable-xhdpi\ 133 | ic_launcher.png 134 | Android_LauncherIcon96 135 | 1 136 | 137 | 138 | True 139 | 140 | 141 | urlManagerMobile\res\drawable-mdpi\ 142 | ic_launcher.png 143 | Android_LauncherIcon48 144 | 1 145 | 146 | 147 | True 148 | 149 | 150 | urlManagerMobile\library\lib\mips\ 151 | liburlManagerMobile.so 152 | AndroidLibnativeMipsFile 153 | 1 154 | 155 | 156 | True 157 | 158 | 159 | urlManagerMobile\library\lib\x86\ 160 | liburlManagerMobile.so 161 | AndroidLibnativeX86File 162 | 1 163 | 164 | 165 | True 166 | 167 | 168 | urlManagerMobile\library\lib\armeabi-v7a\ 169 | gdbserver 170 | AndroidGDBServer 171 | 1 172 | 173 | 174 | True 175 | 176 | 177 | urlManagerMobile\res\drawable\ 178 | splash_image_def.xml 179 | AndroidSplashImageDef 180 | 1 181 | 182 | 183 | True 184 | 185 | 186 | urlManagerMobile\res\values\ 187 | styles.xml 188 | AndroidSplashStyles 189 | 1 190 | 191 | 192 | True 193 | 194 | 195 | 196 | -------------------------------------------------------------------------------- /source/FirebaseCloudMessaging.deployproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 5 | 6 | 7 | ZY223PNH2N 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | FirebaseCloudMessaging.app\Contents\MacOS\ 16 | libcgsqlite3.dylib 17 | DependencyModule 18 | 1 19 | 20 | 21 | True 22 | 23 | 24 | FirebaseCloudMessaging.app\Contents\MacOS\ 25 | libcgunwind.1.0.dylib 26 | DependencyModule 27 | 1 28 | 29 | 30 | True 31 | 32 | 33 | 34 | 35 | FirebaseCloudMessaging\assets\internal\ 36 | libcrypto.so 37 | File 38 | 0 39 | 40 | 41 | True 42 | 43 | 44 | FirebaseCloudMessaging\library\lib\armeabi-v7a\ 45 | libFirebaseCloudMessaging.so 46 | ProjectOutput 47 | 1 48 | 49 | 50 | True 51 | True 52 | 53 | 54 | FirebaseCloudMessaging\res\drawable-ldpi\ 55 | ic_launcher.png 56 | Android_LauncherIcon36 57 | 1 58 | 59 | 60 | True 61 | 62 | 63 | FirebaseCloudMessaging\ 64 | AndroidManifest.xml 65 | ProjectAndroidManifest 66 | 1 67 | 68 | 69 | True 70 | 71 | 72 | FirebaseCloudMessaging\library\lib\armeabi\ 73 | libFirebaseCloudMessaging.so 74 | AndroidLibnativeArmeabiFile 75 | 1 76 | 77 | 78 | True 79 | 80 | 81 | FirebaseCloudMessaging\res\drawable-hdpi\ 82 | ic_launcher.png 83 | Android_LauncherIcon72 84 | 1 85 | 86 | 87 | True 88 | 89 | 90 | FirebaseCloudMessaging\res\drawable-xxhdpi\ 91 | ic_launcher.png 92 | Android_LauncherIcon144 93 | 1 94 | 95 | 96 | True 97 | 98 | 99 | FirebaseCloudMessaging\res\drawable-normal\ 100 | splash_image.png 101 | Android_SplashImage470 102 | 1 103 | 104 | 105 | True 106 | 107 | 108 | FirebaseCloudMessaging\res\drawable-large\ 109 | splash_image.png 110 | Android_SplashImage640 111 | 1 112 | 113 | 114 | True 115 | 116 | 117 | FirebaseCloudMessaging\res\drawable-small\ 118 | splash_image.png 119 | Android_SplashImage426 120 | 1 121 | 122 | 123 | True 124 | 125 | 126 | FirebaseCloudMessaging\res\drawable-xlarge\ 127 | splash_image.png 128 | Android_SplashImage960 129 | 1 130 | 131 | 132 | True 133 | 134 | 135 | FirebaseCloudMessaging\res\drawable-xhdpi\ 136 | ic_launcher.png 137 | Android_LauncherIcon96 138 | 1 139 | 140 | 141 | True 142 | 143 | 144 | FirebaseCloudMessaging\assets\internal\ 145 | libssl.so 146 | File 147 | 0 148 | 149 | 150 | True 151 | 152 | 153 | FirebaseCloudMessaging\res\drawable-mdpi\ 154 | ic_launcher.png 155 | Android_LauncherIcon48 156 | 1 157 | 158 | 159 | True 160 | 161 | 162 | FirebaseCloudMessaging\library\lib\mips\ 163 | libFirebaseCloudMessaging.so 164 | AndroidLibnativeMipsFile 165 | 1 166 | 167 | 168 | True 169 | 170 | 171 | FirebaseCloudMessaging\library\lib\armeabi-v7a\ 172 | gdbserver 173 | AndroidGDBServer 174 | 1 175 | 176 | 177 | True 178 | 179 | 180 | FirebaseCloudMessaging\classes\ 181 | classes.dex 182 | AndroidClassesDexFile 183 | 1 184 | 185 | 186 | True 187 | 188 | 189 | FirebaseCloudMessaging\res\drawable\ 190 | splash_image_def.xml 191 | AndroidSplashImageDef 192 | 1 193 | 194 | 195 | True 196 | 197 | 198 | FirebaseCloudMessaging\res\values\ 199 | styles.xml 200 | AndroidSplashStyles 201 | 1 202 | 203 | 204 | True 205 | 206 | 207 | FirebaseCloudMessaging\ 208 | libFirebaseCloudMessaging.so 209 | AndroidLibnativeX86File 210 | 0 211 | 212 | 213 | True 214 | 215 | 216 | 217 | 218 | FirebaseCloudMessaging.app\ 219 | libcgunwind.1.0.dylib 220 | DependencyModule 221 | 1 222 | 223 | 224 | True 225 | 226 | 227 | FirebaseCloudMessaging.app\ 228 | libPCRE.dylib 229 | DependencyModule 230 | 1 231 | 232 | 233 | True 234 | 235 | 236 | 237 | --------------------------------------------------------------------------------