Creating a Batch.com cordoba plugin

  

Hi guys,

Has anyone ever created a plugin cordova component of Batch.com?


GitHub | BatchLabs

Regarts,

Nuno

You mean an OutSystems mobile plug-in using the Cordova plug-in you linked to? :) I have not, but it's pretty easy to create one yourself

Hi Kilian,

Thank you for your answer.
I've read all the documentation from Outsystems. I've also tried both the public repository URL and the ZIP file from Resources folder from the Data tab. With different alternatives, and I always get errors generating the application in ServiceCenter, due to lack of files.



Mmm, that would mean the git is not quite right... Well, like I said, I haven't tried it myself, but perhaps you could post the errors here, and others that know more could answer.

Here is the log error in generating the application for iOS:

[2018-04-10T14:27:33.581Z] [ERROR]

You have been opted out of telemetry. To change this, run: cordova telemetry on.

No scripts found for hook "before_plugin_add".

Calling plugman.fetch on plugin "https://github.com/sirg2003/batch-cordova-plugin.git"

Fetching plugin "https://github.com/sirg2003/batch-cordova-plugin.git" via git clone

Running command: git clone --depth=1 https://github.com/sirg2003/batch-cordova-plugin.git /var/folders/ck/3n6zynl52nbdjbwqjhgj49fm0000gq/T/git/1523370435005

Command finished with error code 0: git clone,--depth=1,https://github.com/sirg2003/batch-cordova-plugin.git,/var/folders/ck/3n6zynl52nbdjbwqjhgj49fm0000gq/T/git/1523370435005

Repository "https://github.com/sirg2003/batch-cordova-plugin.git" checked out to git ref "master".

/tmp/build/source/plugins/com.batch.cordova"...

Plugin "com.batch.cordova" fetched.

Calling plugman.install on plugin "/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/plugins/com.batch.cordova" for platform "ios

Installing "com.batch.cordova" for ios

Running command: /Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/version

Command finished with error code 0: /Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/version

Finding scripts for "before_plugin_install" hook from plugin com.batch.cordova on ios platform only.

No scripts found for hook "before_plugin_install".

Install start for "com.batch.cordova" on ios.

Beginning processing of action stack for ios project...

Error during processing of action! Attempting to revert...

Failed to install 'com.batch.cordova':CordovaError: Uh oh!

Cannot find resource file "/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/plugins/com.batch.cordova/src/ios/Batch.bundle" for plugin com.batch.cordova in iOS platform

    at handlers.resource-file.install (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/lib/plugman/pluginHandlers.js:53:48)

    at Object.ActionStack.process (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)

    at PluginManager.doOperation (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/node_modules/cordova-common/src/PluginManager.js:117:20)

    at PluginManager.addPlugin (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/node_modules/cordova-common/src/PluginManager.js:147:17)

    at Api.addPlugin (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/Api.js:235:10)

    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:611:6)

    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:407:28

    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)

    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)

    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

Error: CordovaError: Uh oh!

Cannot find resource file "/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/plugins/com.batch.cordova/src/ios/Batch.bundle" for plugin com.batch.cordova in iOS platform

    at handlers.resource-file.install (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/lib/plugman/pluginHandlers.js:53:48)

    at Object.ActionStack.process (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)

    at PluginManager.doOperation (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/node_modules/cordova-common/src/PluginManager.js:117:20)

    at PluginManager.addPlugin (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/node_modules/cordova-common/src/PluginManager.js:147:17)

    at Api.addPlugin (/Users/mabs01/NativeBuilder/builds/65cb936a-877c-4d2b-856f-927913a67e7d/source/platforms/ios/cordova/Api.js:235:10)

    at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:611:6)

    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:407:28

    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)

    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)

    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)


[2018-04-10T14:27:33.582Z] [ERROR] Build failed with the following error: Error installing Cordova plugin: com.batch.cordova.

[2018-04-10T14:27:33.582Z] [INFO] Zipping application source...

[2018-04-10T14:27:58.158Z] [INFO] Application was not successfully generated!

[2018-04-10T14:27:58.158Z] [INFO] Execution time: 125844ms


Thanks to everyone, with the help of my team, we detected the problem with the package that is in GitHub.

Best Regards,
Miguel

Hi Nuno,

Can you give us some details about what you did?

So that in the future if someone finds this post they know what to do...


Thanks,

João Heleno

Hi João,

It was creating a fork of the existing package and fixed the problem.
The main problem here was due to the XML paths that were not correct, nor the location of the folders.


Regards,
Miguel