codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Home Page:https://www.codenameone.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide app review Library (cn1lib)

danieltsai1230 opened this issue · comments

Both iOS and Android include an App Review API that shows a "please review the app" widget after a few days to increase engagement. Codename One has such a widget but it's written in Codename One and stores might reject this due to policy changes after it was introduced.

This should be a relatively simple library with a couple of native OS calls and maybe a fallback implementation that uses the existing code. This seems like an easy task for the community and can be implemented as a library.

Originating stackoverflow thread.

Edited your RFE for clarity

commented

Hi @shai-almog I would like to work on this issue.

Hii, Can you help me to work on this issue ?

Sure. You need to create a library project and publish it as covered in this tutorial.

This library should use native interfaces which you can read about in the developer guide.

The iOS and Android implementation should provide a simple call to invoke the app review functionality. For iOS you would do it like this.

For Android you would do it like this.

Do i have to create a java library ?
also can you please elaborate me more how to solve this issue. Please

Sort of. You need a library through Codename One. See the first link I listed. You need access to native interfaces so you can invoke the native iOS/Android APIs respectively.

I am still confused where to start.
I have to create a library for review using maven but how would i integrate native and which code should i use
https://developer.android.com/guide/playcore/in-app-review/kotlin-java do i have to use this code for android but where to paste this code idk

See this: https://github.com/codenameone/cn1-codescan

This is a maven Codename One library for a QR/Barcode scanner that uses maven and native interfaces. You can use that as a reference.

See this: https://github.com/codenameone/cn1-codescan

This is a maven Codename One library for a QR/Barcode scanner that uses maven and native interfaces. You can use that as a reference.

which software should i use to do this? also do i have to create different file for android, ios, common then merge it?

You can use IntelliJ or Android Studio. Just open the root project. In it you can see the hierarchy. Android native code goes under the Android directory and so on. You define a native interface and it will let you generate native stubs for all the OSs via the maven target.

i am getting only this kind of file structure not android, ios etc etc in intellij on choosing maven archtype project
image

This is a standard maven project. I think for a library you need to copy one of the templates from @shannah
Maybe he has a better reference for that.

is this issue still open ?