Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pknotfound committed Aug 4, 2021
2 parents f49bd87 + 0589f12 commit e92e441
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ Add the dependency

# Implementation

private val openGraphParser = OpenGraphParser(this)
private val openGraphParser = OpenGraphParser(this, showNullOnEmpty = true)

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

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.

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.

The data class ***OpenGraphResult*** contains:


Expand Down

0 comments on commit e92e441

Please sign in to comment.