New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cordova / PhoneGap / Ionic Support #261

Open
timanglade opened this Issue Feb 19, 2016 · 52 comments

Comments

Projects
None yet
@timanglade
Contributor

timanglade commented Feb 19, 2016

No description provided.

@appden

This comment has been minimized.

Contributor

appden commented Feb 25, 2016

I just rebased and pushed my older WIP branch, sk-cordova, which pretty much completes this task. 😄

@appden

This comment has been minimized.

Contributor

appden commented Feb 25, 2016

I mean for iOS. For Android, this is pretty much blocked on #262 being done.

@keithdmoore

This comment has been minimized.

keithdmoore commented May 7, 2016

👍 for Ionic support. Hopefully Ionic2!

@mlynch

This comment has been minimized.

mlynch commented Jun 2, 2016

This would be awesome and well received in the Ionic community for sure. Curious why this wouldn't Just Work given the recent realm-js release?

@pjhartin

This comment has been minimized.

pjhartin commented Jun 2, 2016

@mlynch I would assume because for phonegap, an interface between the js library to the native hardware of the device would need to be developed to actually bring the benefit of realms speed. But then again, I have no idea.

@alazier

This comment has been minimized.

Contributor

alazier commented Jun 3, 2016

The main issue with supporting phonegap/cordova at the moment is the need to support android. React Native runs on JavascriptCore on both iOS and android which is how we support both platforms. This is not the case for cordova/phonegap.

@Ross-Rawlins

This comment has been minimized.

Ross-Rawlins commented Jun 15, 2016

+1

1 similar comment
@caiobalthazar

This comment has been minimized.

caiobalthazar commented Jul 23, 2016

+1

@douglasjunior

This comment has been minimized.

douglasjunior commented Jul 26, 2016

It's a good option to create a cordova-plugin to use realm-java and realm-cocoa?

As in https://github.com/mapsplugin/cordova-plugin-googlemaps

@PierBover

This comment has been minimized.

PierBover commented Sep 6, 2016

The main issue with supporting phonegap/cordova at the moment is the need to support android

@alazier can you expand on that?

@alazier

This comment has been minimized.

Contributor

alazier commented Sep 6, 2016

@PierBover - the way the Realm binding works is that we hook directly into the JS context for whatever environment we are supporting. React-native uses the same version of JavascriptCore on both ios and android which makes integration pretty straightforward. Cordovoa uses whatever the builtin JS interpreter is on the device it is running on, which makes things much more difficult. It might be possible to make things work by rolling a custom version of Cordova but this isn't something we have looked into. If you just want to support Cordova/iOS then it should be possible to get things working using the current codebase by getting the JSContext from a webview and passing it into the Realm initialization methods, but this is not something that we can currently support or maintain.

@PierBover

This comment has been minimized.

PierBover commented Sep 6, 2016

Ok I see the problem.

Probably the best way to go for Cordova/Phonegap is making a native plugin (since you already have native iOS and Android libraries) with a JS wrapper API that mimics the one used in your React Native implementation.

@virtualprodigy

This comment has been minimized.

virtualprodigy commented Oct 17, 2016

My team really wants Realm for Cordova/Ionic. Any updates on if/when Cordova support would rollout?

@ghost

This comment has been minimized.

ghost commented Nov 10, 2016

+1

@caiobalthazar

This comment has been minimized.

caiobalthazar commented Nov 10, 2016

I believe a plugin approach such as the one described by @PierBover would be the easiest way to do it.

@kitfactory

This comment has been minimized.

kitfactory commented Nov 19, 2016

+1

@faraazc

This comment has been minimized.

faraazc commented Nov 24, 2016

+1 ionic2 support is really wanted in the community. This will open doors for PWA as well.

@AresDev

This comment has been minimized.

AresDev commented Dec 5, 2016

+1

1 similar comment
@gozur

This comment has been minimized.

gozur commented Dec 19, 2016

+1

@ghost

This comment has been minimized.

ghost commented Dec 20, 2016

+1 IONIC2 support is wanted

@krasnokojiy

This comment has been minimized.

krasnokojiy commented Dec 21, 2016

+1

3 similar comments
@konrin

This comment has been minimized.

konrin commented Dec 25, 2016

+1

@IvanAR

This comment has been minimized.

IvanAR commented Jan 2, 2017

+1

@llearn

This comment has been minimized.

llearn commented Jan 4, 2017

+1

@gkTim

This comment has been minimized.

gkTim commented Jan 26, 2017

Any news on this?

@jruef

This comment has been minimized.

jruef commented Feb 6, 2017

+1

@istx25

This comment has been minimized.

istx25 commented Feb 6, 2017

As far as I know, this is not something that we are actively working on right now.

@zuhrulumam

This comment has been minimized.

zuhrulumam commented Feb 15, 2017

+1

@danmatthews

This comment has been minimized.

danmatthews commented Feb 15, 2017

Damn, it's a shame that this isn't something that's actively being worked on - i think it's a big market potentially.

In the meantime, if you're not working on this, can someone close it and update it with some official news?

In the meantime guys - the best alternative is PouchDB with the sqlite adapter.

@jruef

This comment has been minimized.

jruef commented Feb 16, 2017

@danmatthews yeah it's a shame. I develop ionic and react native apps. For react native you can use pouchdb-adapter-react-native-sqlite and pouchdb-react-native :-) and realmjs supports react native.

@danmatthews by the way the first link in your comment is broken

@kristiandupont

This comment has been minimized.

Contributor

kristiandupont commented Feb 16, 2017

Yeah, sorry, the official news is that @istx25 is right. This is not something we are working on at the moment. I realize that it's a popular request and definitely something we will look into but at the moment, the JS team has plenty of work with the currently supported platforms. I'll keep the issue open as it's neither done nor rejected, just idle :-)

@danmatthews

This comment has been minimized.

danmatthews commented Feb 16, 2017

No worries! Thanks for getting back to us and letting us know the status.

@AsimNet

This comment has been minimized.

AsimNet commented Feb 20, 2017

+1

@bmunkholm

This comment has been minimized.

Contributor

bmunkholm commented Feb 24, 2017

@useitsoftware

This comment has been minimized.

useitsoftware commented Apr 19, 2017

+1 any chance of rethinking on this? angular2/angular4 and ionic 2 are growing platforms with a lot of popularity. You could partner with the ionic team to share the development burden.

@malhobayyeb

This comment has been minimized.

malhobayyeb commented May 9, 2017

+1

@tryadelion

This comment has been minimized.

tryadelion commented May 24, 2017

@kristiandupont @alazier could you please try to throw this back on the #Maybe deck ? Ionic2/Angular2 & ionic3/Angular4 both lack a solid mautre & stable database system like Realm behind and their platform and numbers of apps is growing fast. showcase.ionicframework.com/apps/newest

@nazrdogan

This comment has been minimized.

nazrdogan commented Jun 5, 2017

+1

2 similar comments
@dav021

This comment has been minimized.

dav021 commented Jun 9, 2017

+1

@yosuke1985

This comment has been minimized.

yosuke1985 commented Jul 10, 2017

+1

@ozexpert

This comment has been minimized.

ozexpert commented Oct 9, 2017

What's the status? I've used React Native with Realm. But want to switch over using Ionic/Cordova with Realm. Blazingly fast database!!

@tryadelion

This comment has been minimized.

tryadelion commented Oct 18, 2017

What is the status again? it's been almost half a year since @kristiandupont 's statement. React native isn't the only cross platform JS framework, centering yourselves on it forces the rest of us to look elsewhere for worse solutions.

@syc-pad

This comment has been minimized.

syc-pad commented Dec 18, 2017

+1

@tryadelion

This comment has been minimized.

tryadelion commented Dec 19, 2017

Feature Request:

Goals

To achieve realm connection between a cordova-based hybrid app and the native library code by creating a cordova Typescript plugin that takes a generically Inputted syntax (RealmJS syntax?, swift syntax?) that redirects to the desired methods in the native code.

Examples of how this works:

https://github.com/arnesson/cordova-plugin-firebase

Expected Results

TS Plugin Usage:

import { RealmDB, RealmObject} from "Realm";
private car : RealmObject = {brand: "honda",subtype:"civic",codename:"grizzlybear",year:"2017",id: 12043};
constructor(realmInstance : RealmDB){
    realmInstance.open().subscribe( () => {
        realmInstance.write(car).subscribe( (res : Boolean) => {
          console.log(res);
        }
    });
}

TS BACKEND:

exports.open = function(success, error) { exec(success, error, "FirebasePlugin", "open"); };

Native IOS:

_let realm = try! Realm()

etc...

native Android:_
if (action.equals("open")) {
return realm.open( etc...
}
etc,,,,_

REASON

Realm.JS isn't made to be used as front end for webview-based hybrid apps, so there must be a way to use it. the easiest is to move the code "behind", and connect to the desired core when platform meets needs.

Possible compatible versions

Android
Ios
Windows 10 UWP (surface, desktop, windows phone All in One)

@bmunkholm

This comment has been minimized.

Contributor

bmunkholm commented Dec 19, 2017

We currently don't have the spare capacity to take on more new platforms. There is a significant amount of work involved in creating, maintaining and providing support for each platform. So we would need the community to step up and assist with this effort. I can see that some effort is being put into https://github.com/airamrguez/cordova-plugin-realm.

@bmunkholm bmunkholm added the T:Feature label Dec 19, 2017

@superandrew

This comment has been minimized.

superandrew commented Jan 25, 2018

+1

@tryadelion

This comment has been minimized.

tryadelion commented Jan 25, 2018

@bmunkholm hey brian, we understand that the capacity to make a new platform from scratch can be breathtaking. the issue with cordova-plugin-realm is that it relies on premade and predefined scheme files, built over json files.
I have no experience on React Native, but i suppose that what it does is detect concrete javascript method calls, and direct them to a native code that takes care of it. correct me if i'm wrong.
doing a Cordova wrapper that connected a Realm-JS'subset' of TS/JS calls with the already existant Realm-JS native (as in android/ios, not as in React) calls (and the already existing RealmJS syntax and boilerplate) could take some time to tinker, and a lot to test for a one man project (like any of us could do, or like cordova-plugin-realm is), but would be fast enough for multiple persons that do know how stuff works behind when doing it.

in the extreme end the community would be in charge of doing this kind of feature, we would appreciate a sample android studio module and ios pod (with their usage guides) with the Native side of the RealmJS calls, that we could later wrap it in a cordova module.
something like:
//run RealmStore.write( JsonObject object ) to open a write transaction, given a valid RealmJS schema object.syncronous method. returns a boolean if success or not.
//run RealmStore.defineSchema(JsonObject object,boolean update) to define a schema. if already exists, it will be ignored unless update is sent. syncronous method. returns a boolean if success or not.

@bmunkholm

This comment has been minimized.

Contributor

bmunkholm commented Jan 26, 2018

@tryadelion As mentioned it's unfortunately not something that we can devote resources for at the moment. Depending on the help needed though, we would need to get some commitment from the community to this.
Perhaps @fealebenpae has input to how best to approach this.

@rethinkedu

This comment has been minimized.

rethinkedu commented Jan 30, 2018

+1

1 similar comment
@kabus202

This comment has been minimized.

kabus202 commented Feb 9, 2018

+1

@RoyGoode

This comment has been minimized.

RoyGoode commented Feb 24, 2018

+1 for Ionic/Cordova

1 similar comment
@clariontools

This comment has been minimized.

clariontools commented Dec 14, 2018

+1 for Ionic/Cordova

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment