Native Plugin For Windows 8 Using Cordova - javascript

I am creating a windows8 plugin in cordova but i want to be integarte native build like .winmd with my plugin so that through Winjs i m calling the functions of that library which is in c#. I had already added the reference and code into plugin folder and as well as in project. But still it throws an error WinRt Error : class is not register/JavaScript Error : class in not defined.
I am creating same plugin in WP but there is issue in windows8 plugin development using cordova winjs with native functionality. please help to resolve this issue, provide some samples , links etc.

Updated:
It seems that to reference a WinRT component from a Cordova project using the current VS Tools for Cordova release, you need to follow the instructions here:
https://msopentech.com/blog/2014/11/24/using-windows-runtime-component-with-cordova-project/
In particular, section 1 describes how to inform the Cordova build tools about your WinRT component(s), so that it can reference it/them in the AppX manifest, and include the component binaries in the output package.
Earlier notes:
Do you need to actually write it as a Cordova plug-in? Windows JS apps support really simply integration of custom WinRT components, which can be written in C++ or C#. You just have to create a new Windows Runtime Component project in your solution, define a public sealed class with the methods/properties you want to expose, and then add a reference from your JS app project to the WinRT component (right-click References, select Add Reference, and choose the component project).
That said, be wary of the performance implications of including a C# component (particularly if you need to load it during startup) and the memory usage implications of loading the CLR and all the .NET dependencies. Also remember that C# is not "native" so it isn't really a "native plugin" if you do that :-)
You also might get slightly better advice if you describe your goal (i.e. you need the native plugin for something where you're actually running against JS performance limitations - which is a fairly exceptional case).

Related

convert angular 2 application to integrate able sdk

i have a angular 2 application. I was wondering if i could convert this application to an integrate-able sdk which other applications can use by adding script tags in their headers. If this is not possible can anyone provide any tutorial link which shows how can i build a simple sdk which can be integrated in other applications. thank you.
Of course you can! In javascript terms, it's not called "SDK" but "module".
The most popular module manager is called NPM.
So you can follow this tutorial to package your "application" as NPM module, then it will be easy for other js developper to integrate it inside their own projects (using the tags, services, directives you defined.
Here is a good post about it
Cheers!
EDIT : if you want to use your angular components/modules outside in non-angular application, you can follow this one. In the example it is used with React app but it will work with any html5-compliant browsers.
If you want to target also non-compatible browsers, you should add a polyfill

Is it possible to plugin create cordova for ionic 3 with Epson ePOS SDK for iOS?

I never created a Cordova plugin, so I would like just know if it's possible to create Cordova plugin for ionic 3 (only ios) with this https://download.epson-biz.com/modules/pos/index.php?page=soft&scat=58 . And can you tell me please what file I need to use for creating a Cordova plugin (only for printing some text). I will put it in git after creating because I need it and show it to some people who need it. I just understand the JavaScript part of it but not objective-c... Thank you.
Really nice idea. You can start by using below link. Good luck!
iOS Plugin Development Guide
This section provides details for how to implement native plugin code
on the iOS platform. Before reading this, see [Plugin Development
Guide][plugin-dev] for an overview of the plugin's structure and its
common JavaScript interface. This section continues to demonstrate the
sample echo plugin that communicates from the Cordova webview to the
native platform and back.
An iOS plugin is implemented as an Objective-C class that extends the
CDVPlugin class. For JavaScript's exec method's service parameter to
map to an Objective-C class, each plugin class must be registered as a
tag in the named application directory's config.xml file.

Searching for a ReactJS Runtime Plugin Concept

does ReactJS support some plugin loading at runtime?
I have developed a client app based on ReactJS. It should be possible for other users of my software to extend the Web UI by writing custom extension.
My ReactJS Base application is already transpiled (webpack + babel) to a build.js file.
Other user should create there own .js file which are loaded by the browser separately. At runtime browser should check for custom extension add these to the application.
Does anyone has a hint how to do this with ReactJS?
Cheers,
Manuel
You can implement a custom javascript function on your main component to add extensions, i.e.:
YourPlugin.loadExtensions(MyCustomExtension);
I've done this for a react component to be mount on a specific node only, but I think this approach should work in your case as well.

Unexpected ReSharper warnings when editing a JavaScript file in a console app

I wrote a small web app using Nancy. I was originally using ASP.NET hosting, but I decided to try Nancy self hosting so I could deploy the app easily to any Windows machine. This involved replacing my ASP.NET Empty Web Application with a Console Application.
Pretty much everything is working well, but I've run into an issue where using certain window functions, such as alert() or escape(), in the JavaScript editor causes ReSharper warnings.
Here's how it looks in the editor:
I could always disable these warnings (or add window. before every call), but I'm wondering if there's anything I can do to have these functions recognized as if my project were an ASP.NET app.
Edit
If I return to my original project (the ASP.NET app) and type alert, here is what I see:
Could this mean that DHtml.js doesn't get loaded/included for console apps? Is there a way to make that happen?
When you create a web project, ReSharper adds some "hidden" js files to its cache that provide definitions for global objects, including the "Dhtml.js" file you mention. These files aren't added for console applications. There's no decent workaround here - ReSharper's web support is primarily based on the idea that you're in a web project of some kind, so there will be other features that are not enabled due to the fact that you're in a console app project.
However, it looks like it's possible to replicate what ReSharper does to add these files from a plugin - instead of looking to see if the project is a web project, it should look to see if it's a console app that also references Nancy. If so, tell ReSharper to internally reference these "hidden" files. I'd suggest posting a feature request to the Nancy ReSharper plugin project.

How can I use a dll compiled with .Net Framework 4.0in a Windows Metro App

I am new to Windows 8 app development and professional C# dev. I have run into a problem where a client wants me to interface with a printer (DYMO 450 Turbo) and the SDK only comes with a dll that has been compiled using .net 4.0 . The samples show referencing the dll from the app which I can not do because the app is written in Javascript using WinJS. The metro apps use NETCore where the dll uses NETFramework. My best solution so far is to write the code to interface with the printer as a server in .NET 4.0 that listens for requests sent from Javascript over XMLHttpRequest. My gut tells me there HAS to be a better way, but either Ihavn't figured it out or maybe I just don't know enough to figure it out yet. Any help would be appreciated. Thanks in advance.
You cannot use a standard .NET 4.0 assembly in a Windows Store app. You can only use WinRT components. That said, your existing component may or may not be easy to convert to a WinRT componenet. If you simply include the project for your .NET 4.0 component and then change the Output Type (under the project properties) to Windows Runtime Component, you can have a look at all of the compiler errors that are thrown and get an idea of how big of a chore it's going to be to convert it. This article will let you know what the restrictions are on WinRT components.
Suggest add a project using project template c# - windows runtime component, to build a winrt component in c# that can use your sdk dll. winrt component can expose a wrapped impl. winrt component can be referenced in the winjs project.
I have used this for simple utils functions but not for integrating with third party sdk. suggest you give it a shot.

Categories

Resources