Calling Paytm SDK using Appcelerator IOS module - ios

I need to Integrate Paytm payment gateway from an Appcelerator project for IOS devices. So I was thinking to use the mobile module to call the SDK. I can build and run their sample SDK using Xcode project and get the result, but having difficulties to implement in my modules. From my understanding:
The SDK is trying to call a webview and send the data then get response from it.
In the SDK ViewController, it extends to UIViewController <PGTransactionDelegate> but the module is extended to TiModule. My guess is that I need to create a ViewController and call it from the module, but somehow it always failed when I build the Appcelerator project using that module. The cause is probably this line in the module function (if I comment it, I can build the project and get the value) :
-(id)makePayment:(id)args {
ViewController *controller = [[ViewController alloc] init];
[[TiApp app] showModalController:controller animated:YES];
NSString *orderID = [args objectAtIndex:0];
return orderID;
}
Is there anyone who able to integrate Appcelerator with Paytm SDK? Any leads or subtle example is very much appreciated.
Paytm SDK : https://github.com/Paytm-Payments/Paytm_iOS_App_Kit
Appcelerator version 4.10
Titanium SDK version 6.1.2.GA
Xcode version 9.1
TBH I am new to both iOS and Appcelerator, but this is client's requirement.

Related

Can I use react-native app's AppDelegate in ios module?

I am writing iOS SDK wrapper for react native.
And the SDK guide gave me the code :
-(void)didClickOpenOfferwallBtn
{
[AdPopcornOfferwall openOfferWallWithViewController:self delegate:self userDataDictionaryForFilter:nil];
[AdPopcornOfferwall shared].delegate = self;
}
So I think if I can get my react-native App's AppDelegate, (like Androids's getReactApplicationContext or getCurrentActivity functions) I can run the code inside of react-native ios module.
Are there some methods to get my current app's AppDelegate in React Native module?

Facebook SDK iOS - how to set Application ID dynamically from code?

I'm trying to set the Facebook's AppId from code, so I can choose to which app to connect to (between 2 apps, one of them is a test app).
Basically I'm looking for an equivalent for Android's SDK call:
FacebookSdk.setApplicationId(ACTIVE_APP_ID);
I'm aware of the deprecated iOS call:
[FBSettings setDefaultAppID:ACTIVE_APP_ID];
But can't seem to find alternative to it.
I'm using SDK ver 4.22.1. Thanks!
FacebookSDK v4.44.1 swift 5 - Set the Facebook App ID used by the SDK:
Settings.appID = "YOUR-FACEBOOK-APPLICATION-IDENTIFIER"
Settings.displayName = "YOUR-FACEBOOK-DISPLAY-NAME"
That's the way I have managed to set it programmatically and override the default settings at the info.plist file.
Maybe you can try :
[FBSDKSettings setAppID:ACTIVE_APP_ID];
(I am using version 4.29.0 of FBSDK).

Unity integrated into native iOS app. App crashes when closing Unity part and trying to reopen it

After following this tutorial I managed to integrate a Unity app into a native iOS app. The problem I'm currently facing is when I try to go back from the Unity part to native iOS.
For Android I solved this by doing something like:
public void ReturnToNative()
{
#if UNITY_ANDROID
AndroidJavaClass jc = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject> ("currentActivity");
jo.Call ("goBack");
#endif
#if UNITY_IOS
Application.Quit();
#endif
}
The native Java method "goBack" basically stops and then finishes an activity that contains the Unity part.
I know that for iOS the solution is not an Application.Quit(), I should use an iOS Plugin.
So my question is, what should this plugin do? How could I make it work?
I know how to create plugins, but I don't know what this particular plugin should contain.
Any help / hint / direction / comment is greatly appreciated!!
PS. I'm using Unity 5.4.2 and Xcode 8.0. The Unity part uses the Google Cardboard SDK.
For using native plugins on iOS read the following info:
https://docs.unity3d.com/Manual/NativePlugins.html
https://docs.unity3d.com/Manual/PluginsForIOS.html
It's been a couple of months since this question, but in case anyone else runs into a similar issue, here's how I managed to resolve this.

Integrating IMA iOS SDK

I have integrated google SDK manually without cocoapods because I'm using it inside a static library. And I have added all the frameworks (AVFoundation,..Etc) needed for IMA SDK.
My app getting crashed whenever I am trying to set IMASettings with the language.
Here is the error:
+[NSDictionary gtm_dictionaryWithHttpArgumentsString:]:
"unrecognized selector sent to"
This is my code :
- (IMASettings *)createIMASettings {
IMASettings *settings = [[IMASettings alloc] init];
settings.language = #"en";
return settings;
}
I have initialized the ads loader here :
self.adsLoader = [[IMAAdsLoader alloc] initWithSettings:[self createIMASettings]];
You miss a category with the method gtm_dictionaryWithHttpArgumentsString
now most likely, this IS part of the SDK but haven't setup the linker right
add -ObjC to your app's linker flags
if that isn't it, you're missing another framework from google - the google toolbox for mac

How to provide Aviary Apikey and Secret to Cordova Plugin for iOS

I currently try to get the aviary sdk to run in combination with a cordova app under iOS.
After installing cordova (3.6.3-0.2.13) and the latest Aviary SDK (4.3.0) and the aviary plugin from https://github.com/m1is/AviaryCordovaPlugin I managed to get a simple example app to work with android.
When I try to build the exact same app for iOS with xcode(6.0.1) and i try to call the cordova.plugins.Aviary.show method, I get the following error in the xcode console:
WebKit discarded an uncaught exception in the
webView:decidePolicyForNavigationAction:request:frame:decisionListener:
delegate: You must provide your Aviary
API key before creating an instance of the AFPhotoEditorController.
Please see the Aviary SDK documentation for details.
I understand from reading the SDK documentation for iOS that aviary changed the apikey/secret setup to require it to put it in the code:
The API key and secret must be provided before instantiating an
instance of AFPhotoEditorController.
and here my problem arises: I do not have any idea on how to submit the apikey/secret to the SDK, all tries changing or adding stuff to the Aviary.m file were unsuccessful (probably since I have no knowledge of ObjectiveC.
So I wonder if anybody had the same problem and is able to point me to the right direction on how to setup the apikey and secret so my cordova app would run under iOS.
It looks like the plugin maintainer was focused on android and the iOS version is unfortunately not on the same standard. If you still have this issue you can solve it by manually editing the plugin's iOS code. Just locate the line self.aviary = [[AFPhotoEditorController alloc] initWithImage:image]; in Aviary.m and add the following few lines above it:
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[AFPhotoEditorController setAPIKey:#"YourAviaryAPIKey" secret:#"YourAviarySecret"];
});

Resources