[Capacitor] Images in Capacitor

Another thread got me thinking… Is there any active work to create image upload (and maybe video upload) plugins in Capacitor? I looked at the Capacitor Github and it still confuses the hell out of me. But I know both Typescript and Java, so I might be able to do something there, if I weren’t so clueless.

Also, I would love an Admob plugin that was solid. I don’t know if that would be easy or hard to write, but it would improve on the current state of affairs if it existed.

1 Like

Any reason why the normal browser support for uploading files wouldn’t be enough?

You might want to take a look at:
https://github.com/ionic-team/capacitor/blob/master/.github/CONTRIBUTING.md
CONTRIBUTING.md, "Directory Structure" is missing several folders · Issue #220 · ionic-team/capacitor · GitHub

This exists in an unfinished state:
https://github.com/ionic-team/capacitor/blob/master/android/capacitor/src/main/java/com/getcapacitor/plugin/Photos.java
https://github.com/ionic-team/capacitor/blob/master/ios/Capacitor/Capacitor/Plugins/Photos/Photos.swift
So this seems to be planned.

Without looking at the details of the existing plugins at all, the major problem would be to overlay/move the existing webview with the native elements of what the Admob library produces - without messing up. Probably not the easiest thing to do.

That’s what I’m using now and it seems fine. But maybe native plugins are fancier? If not, why bother building them? The Admob one is what I’m really interesting in though. An image uploader would be a project to learn from.

Fancier is definitely possible, also customized, using “the platform way” etc. A good way to actually request that would be to create an issue on the repo though.

If you want to start developing the plugin yourself, did you read Josh’s post on custom code and plugins?
https://www.joshmorony.com/running-custom-native-ios-code-in-ionic-with-capacitor/
https://www.joshmorony.com/publishing-a-custom-ios-capacitor-plugin-on-npm/

Tried to use the existing Cordova Admob plugins already? There exist a hand full of those, and this might get you to results faster - unless you of course don’t like those.

I posted this issue in September 2017, so no, I don’t like what currently exists.

I’m more interested in potentially learning a skill than I am in asking someone else to write something. I felt a bit held hostage by he Admob plugins, frankly, in part because I didn’t have the skill to make a PR. So I’d like to understand Capacitor much better than I understand Cordova.

I read his emails announcing those posts! They’re on my todo list. You mentioning them makes me give them a higher priority. Next week sometime I hope.

1 Like

Good decision. As usual his content is top notch and will make it a lot easier to jump in and play around yourself. (I personally also didn’t get to the plugins - but what I have seen doesn’t look too complicated. Don’t know about external libraries etc though)

1 Like

Experiencing the same. I know Java and TypeScript, am working on a Contacts plugin, and it’s going to be an interesting experience. Probably a lengthy one too.

On a side note, it took me 2 days to get capacitor generate:plugin to work, so it might be a rocky road on this end