Skip to content

Commit 33f06e0

Browse files
authored
Update README.md
1 parent 165d81f commit 33f06e0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# OpenGraphParser
23
[![](https://jitpack.io/v/Priyansh-Kedia/OpenGraphParser.svg)](https://jitpack.io/#Priyansh-Kedia/OpenGraphParser)
34

@@ -36,13 +37,14 @@ Add the dependency
3637

3738
# Implementation
3839

39-
private val openGraphParser = OpenGraphParser(this, showNullOnEmpty = true)
40+
private val openGraphParser = OpenGraphParser(this, showNullOnEmpty = true, context = this)
4041

4142
openGraphParser.parse(linkUrl) // To parse the link provided
4243

4344
The class required you to implement two callback functions, `onError(error: String)` and `onPostResponse(openGraphResult: OpenGraphResult)`. The former is invoked in case of error (incorrect url), and the latter is invoked on successful response.
4445

4546
The `showNullOnEmpty` is an optional parameter, with a default value of `false`. If set to `true`, the parser would invoke `onError` if the `title` and `description` are empty for the link provided.
47+
The `context` is also an optional parameter. If context is provided, then caching is implemented, and link preview can be generated faster.
4648

4749
The data class ***OpenGraphResult*** contains:
4850

0 commit comments

Comments
 (0)