Git Product home page Git Product logo

my-first-realm-app's Introduction

My first Realm App

GitHub license

This repo contains a simple todo app for iOS and Android that can synchronise your todo's between devices via Realm Object Server.

Checkout the README.md in each directory!

Contributing

See CONTRIBUTING.md for more details!

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

License

Distributed under the Apache license. See LICENSE for more information. analytics

my-first-realm-app's People

Contributors

bdash avatar bmunkholm avatar cbush avatar cmelchior avatar dhmspector avatar emanuelez avatar ericjordanmossman avatar fealebenpae avatar ianpward avatar kneth avatar mbalex99 avatar nhachicha avatar nirinchev avatar roberhofer avatar tgoyne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

my-first-realm-app's Issues

incorrect auth url for android fullsync

Following directions for getting started: https://docs.realm.io/sync/getting-started-1/android-quick-start/step-1-my-first-realm-app

Updated Constants.java correctly, build and runs fine.

Then, attempt to login with a nickname

Expected Results

Expected to login successfully

Actual Results

SyncUser.logInAsync throws an error to the client

Stacktrace showed it was returning an empty header, so I checked the Constants file and realized it was trying to access the cloud via http instead of https which couldn't be right, so I made the change and that fixed it.

Code Sample

Changed this line in Constants.java from...

public static final String AUTH_URL = "http://" + INSTANCE_ADDRESS + "/auth";

to...

public static final String AUTH_URL = "https://" + INSTANCE_ADDRESS + "/auth";

Version of Realm and tooling

Realm version(s): Cloud / Realm Platform / Realm Sync

Android Studio / XCode version: 3.2.1

Which device OS version and device: Mac 10.13/6

Does not work with non-cloud ROS

I had to change my constants file to look like the following for it to work with on-prem ROS:

struct Constants {
    // ****
    // **** Replace the "MY_INSTANCE_ADDRESS" here with the hostname of your
    // **** Realm Cloud instance or the URL of your on-premises Realm Object Server
    // ****
    
    static let AUTH_URL = URL(string: "http://127.0.0.1:9080")!
    
    static var REALM_URL: URL {
        let realmsUrlString = Constants.AUTH_URL.absoluteString.replacingOccurrences(of: "http://", with: "realm://")
        return URL(string: "\(realmsUrlString)/ToDo")!
    }
    
}```

Make sure iOS and Android models matches

Having the same Realm schema on iOS & Android will allow cross binding tests.

  • Make sure the model matches in all tutorials
  • Test that each tutorial work across binding

Android: UI Enhancement - remove "cancel" button from login panel

Suggestion - it occured to me that cancelling out of the login panel on Welcome screen results in a blank screen on the Android version with no way to get the panel back up.

It was the same on the iOS version; there's really no other activity possible in that mode, so I removed the cancel button so the user always has the login panel up if they're not logged in.

logout/login doesn't resume syncing

  • Use objectPermission tutorial
  • Login and start syncing some tasks
  • Open Realm Studio to observe changes to the reference Realm
  • Logout from the app
  • Login with the previous user
  • Modifications are not uploaded, same for changes operated by Studio are not downloaded

Unable to login using SyncCredentials.usernamePassword

Expected Results

Ability to login using SyncCredentials.usernamePassword

Actual Results

Thread 1: Fatal error: The provided credentials are invalid or the user does not exist.

Steps & Code to Reproduce

Describe your current debugging efforts.

Code Sample

I replace the call to
let creds = SyncCredentials.nickname(username, isAdmin: true)
with
let creds = SyncCredentials.usernamePassword(username: username, password: username, register: true)

Version of Realm and tooling

Realm version(s): ? 3.5.0
Realm Cloud

Android Studio / XCode version: ? Xcode 9.3

Which device OS version and device: ? iOS 11 Simulator

URLs can be more friendly to self-hosted users

Within the constants file:

// **** ROS On-Premises Users
// **** Replace the AUTH_URL string with the fully qualified address of your ROS server, e.g.:
// **** "http://127.0.0.1:9080" and "realm://127.0.0.1:9080"

Should really read:

// **** ROS On-Premises Users
// **** Replace the MY_INSTANCE_ADDRESS string with the fully qualified address of your ROS server, e.g.:
// **** "http://127.0.0.1:9080" 

iOS Full Sync Demo App does not seem to work.

Expected Results

Be able to see todo list items synced from the cloud instance

Actual Results

No items at all

Steps & Code to Reproduce

  • I've download the example files for iOS (02-full-sync in specific), installed the pod and created a new Cloud Instance
  • I updated Constants.swift with the correct value in the MY_INSTANCE_ADDRESS let.
  • Opened Realm Studio and created a new realm ("ToDo") in that instance.
  • Then I run the app in the simulator
  • Register a new user
  • Add a todo item

Untill this point it seems to work correctly, but if I open Realm Studio, and the ToDo realm in particular, it displays:

This Realm has no classes defined

And after that if I remove the app from my simulator's springboard en re-run it.
After logging in, with the same user, my previously created todo item is gone.

I would expect it to be there, since it should be stored in the cloud, but it's not.
In Realm Studio I do see the newly registered user.

Code Sample

The 02-full-sync iOS example project

Version of Realm and tooling

Realm version: 4.4.1
XCode version: 11.2
Which device OS version and device: iPhone 8 simulator (13.2)

remove work around for objectPermission demo

objectPermission is still registering an async query & wait for the UPDATE state as a signal that the permission schema has been synchronised from the server. This could be avoided by using an asyncOpen that starts with a schema-less Realm then waitForChange (similar to what Cocoa is doing).

This should be fixed once realm/realm-java#5812 is implemented

Object Level Permission

This issue discusses the design of the ObjectLevelPermission tutorial, once it's available for the bindings.

we could use this type of permission configuration https://github.com/realm/realm-sync/pull/1868/files#diff-0e3567aa4be9697779a43bc487abdcf9R441 which should allow creating a normal class where users can modify their objects, but not necessarily see objects of other users.

It the context of the ToDo app this could be translated into restricting access into the Project class, so only the owner can see it & modify it. I think it's a nice transition from the PartialSync demo where everyone can still query for others Project and edit them

WDYT @dhmspector @bigfish24 ?

Bug in ObjectPermissions

Steps & Code to Reproduce

Login with a nickname
Uninstall / Reinstall the app
Login with the same nickname

Code Sample

  /**
    Returns the class-wide permissions for the named class.

     - parameter cls: The name of an Object subclass to get the permissions for.
     - returns: The class-wide permissions for the named class.
     - requires: className must name a class in this Realm's schema.
     - requires: This must only be called on a partially-synced Realm.
    */
 public func permissions(forClassNamed className: String) -> List<Permission> {
        let classPermission = object(ofType: ClassPermission.self, forPrimaryKey: className)!
        return classPermission.permissions
    }
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value

Also, 3 permissions are added and a new partial path with the same user
capture d ecran 2018-04-11 a 13 25 57
capture d ecran 2018-04-11 a 13 26 48

Version of Realm and tooling

Realm version(s): 3.3.0 & 3.3.2
XCode version: Xcode 9.3
Which device OS version and device: iPhone 8 (11.3)

Cannot Find Symbol Class PermissionManager

Expected Results

Launch the app

Actual Results

Build Failed: error: cannot find symbol class PermissionManager

Steps & Code to Reproduce

Following the docs here, cloned the repo:
git clone https://github.com/realm/my-first-realm-app

opened in Android studio:
<root>/my-first-realm-app/android/todo-full-sync

Code Sample

in Project build.gradle:

dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath "io.realm:realm-gradle-plugin:6.0.0"
    }

in app build.gradle:

apply plugin: 'realm-android'

ProjectsActivity.java:

Screen Shot 2019-10-09 at 4 04 30 PM

Version of Realm and tooling

Realm version(s): 6.0.0

Android Studio version: 3.5.1

Which device OS version and device: Android emulator Pixel 3 API 29

Wrong app name on Android

Expected Results

I would expect the application to be named "Todo"

Actual Results

I appears as "Welcome"

Steps & Code to Reproduce

Build and install the application

Version of Realm and tooling

Realm version(s): ?

Android Studio version: 3.0.1

Which device OS version and device: Android 8.1.0 on Nexus 5X

ToDo Xcode app metadata

The iOS tutorial calls for adding some new files to a clone of this project (eg. here) and doing this generates a template copyright header at the top of the new file. But the auto copyright is going to "Maximilian Alexander" which I believe is incorrect for new files, and may confuse people. I suggest removing this name from the Xcode project metadata entirely or changing it to "Realm"

Screen Shot 2018-03-13 at 16.11.43.png

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.