Skip to content
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

adding new functions into the 1.1 version #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion branch-cordova-sdk.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "2.0"
version: "1.0"
version: "1.1"
maintainer: "Thibaut Gudin <[email protected]>"
authors: "Thibaut Gudin <[email protected]>"
homepage: "git+https://github.com/Thibaut-Gudin/ocaml-branch-cordova-sdk"
Expand All @@ -13,4 +13,6 @@ depends: [
"ocaml" { >= "4.08.0" }
"dune" {>= "2.7"}
"gen_js_api"
"js_of_ocaml"
"js_of_ocaml-ppx"
]
24 changes: 18 additions & 6 deletions src/branch_cordova.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@ val send_branch_event : name:string -> Ojs.t -> unit

type data

val init_session_then : (data -> unit) -> unit
[@@js.global "Branch.initSession().then"]
module InitSession : sig
type t

val get_clicked_branch_link : data -> bool [@@js.get "clicked_branch_link"]
val init_session : unit -> t [@@js.global "Branch.initSession"]

val get_canonical_url : data -> string [@@js.get "$canonical_url"]
val then_ : t -> (data -> unit) -> unit [@@js.call]
end

val get_non_branch_link : data -> string [@@js.get "+non_branch_link"]
val get_clicked_branch_link : data -> bool option
[@@js.get "+clicked_branch_link"]

(*val get_form_data : data -> x:string -> string [@@js.get x]*)
val get_canonical_url : data -> string option [@@js.get "$canonical_url"]

val get_non_branch_link : data -> string option [@@js.get "+non_branch_link"]

val get_match_guaranteed : data -> bool option [@@js.get "+match_guaranteed"]

val get_campaign : data -> string option [@@js.get "~campaign"]

val get_channel : data -> string option [@@js.get "~channel"]

val get_feature : data -> string option [@@js.get "~feature"]