I am currently developing a phonegap 2.7.0 web application in xcode 4.5.2 for iOS 6. One of the key features of my web application is video recording with a duration of six seconds. To achieve this, I followed the process outlined on "https://github.com/piemonte/PBJVision".
Now, I am working on integrating native iOS functionalities with Phonegap using CDVPlugin. Specifically, when a user clicks on a camera icon on the homescreen.html page, it triggers an onclick event and calls the -(void) _setup() method in the PBJViewController.m file. This action results in hiding the main screen and displaying the camera options with a custom design.
To accomplish this, I placed several files including PBJViewController.h & PBJViewController.m, PBJStrobeView.h & PBJStrobeView.m, PBJVisionUtilities.h & PBJVisionUtilities.m, as well as PBJVision.h & PBJVison.m into the plugins folder.
Subsequently, I created a JavaScript file named PBJViewController.js and added it to the www folder.
PBJViewController.js
function PBJViewController()
{
}
loadingalert.prototype._setup = function()
{
//this.resultCallback(res);
cordova.exec("PBJViewController._setup");
}
cordova.addConstructor(function() {
if(!window.plugins)
{
window.plugins = {};
}
//window.plugins.loadingalert = new PBJViewController();
window.loadingalert = new PBJViewController();
});
Following that, I implemented calling code in the video() function within the homescreen.html file.
homescreen.html
function video()
{
alert("video function");
$('#loader').hide();
$('#divcontroller').hide();
$('#menuid').hide();
$('#home_feeds').hide();
loadingalert._setup();
//window.plugins.loadingalert._setup();
//objloading._setup();
//window.location = "js-call:myObjectiveCFunction";
//window.location.href='video.html?user_id='+userid+'&fb_token='+getValue("fb_token");
}
Furthermore, I made some modifications in the PBJViewController.h file.
PBJViewController.h
#import <UIKit/UIKit.h>
#import <Cordova/CDVPlugin.h>
@interface PBJViewController : CDVPlugin <UIWebViewDelegate>
{
IBOutlet UIWebView *webView;
}
-(void)_setup:(NSMutableArray*)paramArray withDict:(NSMutableDictionary*)options;
@end
And In PBJViewcontroller.m file
#import "PBJViewController.h"
#import "PBJVision.h"
#import "PBJStrobeView.h"
#import <Cordova/CDVPlugin.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <MediaPlayer/MediaPlayer.h>
// Remaining content from the original text...
In the process of implementing these changes, I encountered a warning message stating 'CDVPlugin' may not respond to 'viewWillAppear:' due to replacing CDVPlugin for UIViewController "@interface PBJViewController : CDVPlugin". Additionally, I included the plugin names and values in the config.xml file.
These details offer insight into one aspect of my project. Despite my efforts, I have not yet achieved the desired outcome. I welcome any suggestions or solutions you may have. Thank you.