Phonegap 2.7 iPhone Torch fail - iphone

I need a torch on my phonegap project (Cordova 2.7.0, xcode 4.6.2), but I cannot activate it on iPhone. I've tested 2 solutions:
The shazron plugin, but it refuses to compile with a lot of errors, even using it's javacript upgrade (include in next solution)
Tom Schreck's upgrade. It did't throw any error, but it fails too. I've tested it on older versions of phonegap, such 2.2.0 with same results.
Any suggestion??
Thanks!

The Tom's solution has erros in the demo file. At least, to toggle the torch you can use window.plugins.torch.toggle(); but it only works in Cordova 2.2.0. ¿Any update for Cordova 2.7.0?

Related

Ionic Native with console log from ionic cordova run ios -c

I have searched all over to get this answer but nothing works.
I am building an iPad app in Ionic 2 that uses various native plugins.
I want to be able to test the native features and observe the console logs but nothing gets logged, using either the ios emulator or an iPad device.
Ideally I also want livereload but I'll take what I can get.
I eventually got to display console logs in Xcode but that involves running
cordova platform prepare
then running the process from Xcode manually every time I make a single edit. This takes much longer than
ionic cordova run ios --target="iPad-Air" -c
Why can I not just see the logs when I use run?
I have looked at where it says the console.log file is saved to but no file gets created. I created the file myself and gave it full 777 permissions and still nothing.
ionic info:
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.0.1
Cordova Platforms : browser 5.0.3 ios 4.5.2
Ionic Framework : ionic-angular 3.7.1
System:
ios-deploy : 1.9.2
Node : v8.8.0
npm : 5.4.2
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
To help anyone else who has trawled the forums and tried all the solutions where it seems everyone else can console.log except you, I will post what I have discovered. This is not a total solution but may identify the cause for some.
I was specifying the target as iPad-Air. When I didn't, the simulator started in iPhone-6. That is not what I wanted but there in my console was a very welcome console log message.
So I experimented a little and found that iPad-Air 10.0 and iPad-Air-2 10.0 and above will log to the console but 9.3 and lower (Not tested exhaustively) would not.
So for me, this solution will let me continue to develop with livereload and console logs and what's left of my hair.
Hopefully it will save someone else's hair loss too.
FYI you can set your chosen device as a project default in platforms/ios/cordova/lib/run.js in the deployToSim function. There should be a line like if (emulator.indexOf('iPhone') === 0) { swap out 'iPhone' (or whatever it is for you) and replace it with 'iPad-Air-2, 10.0' or whatever you need and have available in your simulator list. ios-sim showdevicetypes
Good luck!

ionic phonegap-facebook-plugin iOS build - CompileC build error

The plugin had been working beautifully up until last night. Getting the following errors on iOS only after updating to latest Ionic/Cordova (android is fine).
Updated to:
xcode version 7.2.1
ionic version 1.7.14
I have also tested the same app with another mac running previous version of ionic 1.7.13 and cordova 6, and all is good.
After testing with the older version, i built a new mac (fresh wives laptop) with the latest ionic setup and again same error.
Here's the plugin in question https://ionicthemes.com/tutorials/about/native-facebook-login-with-ionic-framework
The following build commands failed:
CompileC build/testFresh.build/Debug-iphonesimulator/testFresh.build/Objects-normal/i386/FacebookConnectPlugin.o testFresh/Plugins/phonegap-facebook-plugin/FacebookConnectPlugin.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
ERROR running one or more of the platforms: Error code 65 for command: xcodebuild with args: -xcconfig,/Applications/AMPPS/www/ionic/testFresh/platforms/ios/cordova/build-debug.xcconfig,-project,testFresh.xcodeproj,ARCHS=i386,-target,testFresh,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Applications/AMPPS/www/ionic/testFresh/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Applications/AMPPS/www/ionic/testFresh/platforms/ios/build/sharedpch
You may not have the required environment or OS to run this project
After banging my head against a wall for a few days, I found that others were having the same issue though it was labeled as a "cordova 6" problem.
Original github issue:
https://github.com/Wizcorp/phonegap-facebook-plugin/issues/1227
Eventually whilst scrolling through known bugs under github for "phonegap-facebook-plugin" i noticed that similar errors had occurred on a previous release, then super Jeduan re-wrote the plugin and released it under the following:
Plugin fix:
https://github.com/jeduan/cordova-plugin-facebook4
The above appears to be working find under cordova 6, xcode version 7.2.1 and ionic version 1.7.14

Titanium Appcelerator Running error on iOS 9.2

Device: iPhone 5 (Model A1429)
iOS version: 9.2 (13C75)
Titanium SDK: 4.0.0.GA
When I tried to run/distribute my app, I faced this error messages
[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld build/iVirtue.build/Debug-iphoneos/iVirtue.build/Objects-normal/arm64/iVirtue normal arm64
[ERROR] : (1 failure)
The warning in TiApp Editor > Deployment Targets said
iOS development requires [5.0, 9.0) but you have 9.2
Initially, when I haven't updated my Titanium Studio and my iOS version, the app was running perfectly. Please help.
I didn't clearly explain it before. The app i made was made on Titanium Studio, so installed the Appcelerator Studio and have the app exported. Now, it's working well. Thank you all, now i can close this matter.
Try to update the Titanium SDK to the latest 5.1.2.GA & all other components as well, because as you said that the app was working fine before so it is something related to the updates.
Use Titanium Studio to update everything available.
This seems to be a problem in your run configuration (or tiapp.xml). I suggest you first delete the run configuration, run the app again to define a new run configuration. Also check tiapp.xml to see if you have any references to iOS version?
You should also clean your project prior to running it after having deleted the run configuration :-)
/John

Unity3d 4.3.1f + Facebook SDK 4.3.6 doesnt build

I am trying everything I can for the last 3 days and I didnt find a way to make this version of their SDK work with the latest unity version (4.3.1).
FB SDK version 4.2.4 works fine on every Unity version I tried, but, 4.3.6 doesnt work with any of them (4.0, 4.1, 4.2 and 4.3).
Always gives me that weird message about java building:
Error building Player: Win32Exception: ApplicationName='C:Program
Files (x86)Javajre7binjavac.exe', CommandLine='-bootclasspath
"E:/adt-bundle-windows/sdk/platforms/android-14android.jar" -d
"E:Unity Projects[project name]TempStagingAreabinclasses" -source 1.6
-target 1.6 -encoding ascii "comfacebookandroidR.java" "comwinterbigbangR.java"', CurrentDirectory='E:Unity Projects[project
name]TempStagingAreagen
Another weird thing, I setup my app to android 2.3.3 (API-10) why the hell it is trying to use android14?
With the combination of Unity 4.3.1 and FB SDK 4.2.4, I finally made it work flawless, but, I think that Ill be missing some good stuff from 4.3.6...
After almost a week long I think I found the problem.
I uninstalled all Java from my computer and installed Java 6 32bits. Now everything works as intended.

Error using barcode scanner in iOS PhoneGap

I am working on barcode scanning App. I have download the sample code from GitHub. When I run that project I get an error. Please help me to solve it.
ERROR: Plugin 'NetworkStatus' not found, or is not a CDVPlugin. Check your plugin mapping in Cordova.plist.
2012-11-28 14:12:36.198 BarCodeScannerCDV[942:40b] FAILED pluginJSON = {"className":"NetworkStatus","methodName":"getConnectionInfo","arguments":["NetworkStatus0"]}
Thanks.
I suggest you to used updated phonegap framework (Cordova 2.2.0), because this was a bug in Cordova 1.6.0.
Please see following comment by Shazron Abdullah in Google Phonegap group:
There is a new Cordova.plist because of the unified JS changes. Check
out the "Cordova Upgrade Guide" in your .dmg (Guides subfolder), or:
"Upgrading Cordova 1.5.0 projects to 1.6.0" step 8 of
https://github.com/apache/incubator-cordova-ios/blob/master/guides/Cordova%20Plugin%20Upgrade%20Guide.md#upgrading-older-cordova-plugins-to-16x
The BarcodeScanner plugin for iOS-Phonegap is stable one, please update your phonegap framework to 2.2.0.
In Phonegap 1.6.0 and below, network connection class name is Network Status but for Phonegap 1.6.1 and above, network connection class name is CDVConnection.