Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26031] Hyperloop: iOS - Constructor with block-argument is unable to return valid instance

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sHyperloop 3.0.5
Fix Version/sn/a
ComponentsHyperloop, iOS
Labelsn/a
ReporterBrian García
AssigneeJan Vennemann
Created2018-05-10T06:56:55.000+0000
Updated2019-04-10T10:46:42.000+0000

Description

Trying to implement BraintreeDropIn the controller instance return null, as a result it can't be presented.
var BraintreeDropIn = require('BraintreeDropIn/BraintreeDropIn');
	var BTDropInRequest = require('BraintreeDropIn/BTDropInRequest');
	var BTDropInController = require('BraintreeDropIn/BTDropInController');
	var BTDropInResult = require('BraintreeDropIn/BTDropInResult');
	var NSError = require('Foundation/NSError');
	var TiApp = require('Titanium/TiApp');
	var request = BTDropInRequest.alloc().init();
	var token ="sometoken"
var controller = BTDropInController.alloc().init();
	var result = BTDropInResult.alloc().init();
	var error = new NSError();
	console.log(controller, result, error);
	var dropIn = BTDropInController.alloc().initWithAuthorizationRequestHandler(token, request, function (controller, result, error) {
		console.log('here');
	});
	console.log(request);
	console.log(dropIn);

	TiApp.app().showModalController(dropIn, true);

Attachments

FileDateSize
build_iphone.log2018-05-10T06:57:22.000+0000575625
metabase-10-iphonesimulator-985858376b81cabfa6f3b13fd4210dfe.h2018-05-10T06:56:09.000+000020077
metabase-cocoapods-bcdc13d42012d5143d2548c404186f3a.json2018-05-10T06:56:09.000+000018541
metabase-mappings-iphonesimulator-10.json2018-05-10T06:56:11.000+0000731986
metabase-mappings-iphonesimulator-8.0.json2018-05-10T06:56:10.000+0000731989
metadata-framework-availability.json2018-05-10T06:56:09.000+00002106
Podfile2018-05-10T06:56:00.000+0000325
symbol_references.json2018-05-10T06:56:09.000+000018118

Comments

  1. Sharif AbuDarda 2018-05-11

    Hello, Please share a full reproducible code/project for us to test. Thanks.
  2. Hans Knöchel 2018-05-11

    Looks valid to me, moving to TIMOB! But I am wondering why this specific constructor would fail.
  3. Brian García 2018-05-11

    Another one:
       var BTAppSwitch = require("Braintree/BTAppSwitch");   
       BTAppSwitch.setReturnURLScheme("com.demo.braintree.payments"); // returns an error regarding method setReturnURLScheme doesn't exist
       BTAppSwitch.returnURLScheme = "com.demo.braintree.payments";//does not have any effect
       
       
  4. Alberto Marcone 2019-04-10

    I'm experiencing the same exact issues on my project. Installed the pods:
       install! 'cocoapods',
                :integrate_targets => false
       
       platform :ios, '9.0'
       target 'BraintreeAlloy' do
       	use_frameworks!
       	pod 'Braintree'
       	pod 'BraintreeDropIn'
       	pod 'Braintree/PayPal'
       
       end
       
    added the first snippet from OP on my project, and I get the error
       Application tried to present a nil modal view controller on target
       
    the controller is indeed null. I get the same error from @bgarcia with the second snippet:
       "BTAppSwitch.setReturnURLScheme is not a function.
       
    Can anyone look into this? I'm using TiSDK 8.0.1 and Hyperloop 4.0.2.

JSON Source