CGE already supporting some iOS services but each publisher requesting different services. We can add this services manually?
- AppsFlyer (most common)
- Facebook Analytics
Also some action games need Haptic vibration, this is important for better user experience. Can we use this service too?
Sorry for the long reply time, somehow I missed an email notification of this forum thread.
Basically, yes – new services can be added quite easily, and all you describe should be possible. Our “services” in CGE are just written in Java (Android) or Objective-C (iOS). So any SDK that supports Objective-C (which includes all iOS SDKs I’ve seen so far ) can be added to CGE.
I didn’t yet make a nice documentation “how to add new iOS service”. But we have a draft/quick/ugly documentation “how to add new Android service” on https://github.com/castle-engine/castle-engine/wiki/Android-Services#adding-new-services , and iOS is mostly the same, I even deliberately made some concepts/classes in iOS services the same to be consistent. In particular, both Java and Objective-C can send “messages” that are received in Pascal by
CastleMessaging unit. So a new service like AppsFlyer and Admob has Pascal side already done. It only needs Objective-C implementation, to basically copy the Java (Android) approach and send the same messages.
Right now new services have to be added as subdirectories of
tools/build-tool/data/ios/services (for iOS), see https://github.com/castle-engine/castle-engine/tree/master/tools/build-tool/data/ios/services . For Android they live in similar https://github.com/castle-engine/castle-engine/tree/master/tools/build-tool/data/android/integrated-services . We could easily enable also scanning some subdirectory of particular project for possible project-specific services, to avoid the need to tweak CGE sources to introduce new services.
- Is this possible? To everything you mentioned: yes
- Let me know if you need me to add some of the above for you. I could e.g. easily add AppsFlyer on iOS to CGE.
- Let me also know if you need to afore-mentioned “way to define new services in project directory, without modifying CGE code”.
Good to hear it’s all possible, I still don’t understand all process (still working on that) but I will try add Flurry, its very simple I added Delphi FMX already. Need only 1 line like this (after convert Objective-C header to Pascal)
But I think need help on Admob rewarded video, this is complicated need callback events (video watch complated or failed)
and last service Haptic, using
UIKit, on Delphi side we can use like this but I dont know how on CGE (I think need help too on this)
haptic:=TUIImpactFeedbackGenerator.Wrap( haptic.initWithStyle(3) );
We need (only for iOS) AppsFlyer, Flurry, Admob and Haptic services for Marketing test (this is not urgent)
OK! Let me know if you need any help with this or would like me to make some of these services on my side, I can do it.
Note: In case of CGE services, you just write using Objective-C code, so you don’t need to convert any headers to Pascal, you can use the iOS API immediately. Often you can pretty much copy-paste solutions from the Objective-C integration examples of each SDK,.