This repository has been archived by the owner on Aug 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
Extended README by adding "how to integrate with a network service" instructions #114
Open
dodikk
wants to merge
10
commits into
eBay:master
Choose a base branch
from
dodikk:docs/readme-service-link
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aec6005
[readme] [service] added intro
dodikk 4dde580
[readme] added cocoapods badge
dodikk 4651783
[docs] [readme] added tasks description
dodikk 29f6d29
[docs] [readme] added service protocols
dodikk 2ea3ff2
[docs] [readme] send message example
dodikk f0062c3
[doc] [readme] added notes on `super.sendText()`
dodikk 94c85ea
[readme] re-phrases user's input foreword
dodikk 14ff10a
[readme] added handler for incoming messages
dodikk 2bea307
[readme] added notes on history handling
dodikk 32b75e1
Update README.md
atainter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took me a while to get around to explaining this. It's the perfect use case for head async prefetching.
To use this, you need to set
doesBatchFetch: Bool = true
on NMessenger. NMessengerViewController should implement theNMessengerDelegate
. You will need to add the optionalfunc batchFetchContent()
to the ViewController. This function will be called when you start to scroll up in the chat history. Ideally, the client should fetch history rather than the server pushing it to the client. The following code describes this functionality:Calling
endBatchFetchWithMessages
clears the lock on the prefetch mechanism so that it can be called again when you continue to scroll up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atainter , i am sorry but i am still unsure how to extend my PR properly. I would be grateful if you elaborated on adding the missing parts and posted the result to a readme (or a wiki page or some other documentation piece for this library).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some topics to cover:
viewWillAppear
Notifies the completion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as
How to handle the "some past offline messages have been pushed by the server" situation you've described in your comment.
goes, NMessenger is not really setup for that. The client is meant to query for past offline message. Currently, you cannot add messages out of order because of the way referencing was built. I would build your server to send history in order so that you can use thebatchFetchContent()
callback.I created a
docs-wip
branch. Can you resubmit the PR to merge with that branch? I'll help edit the docs to further explain 1 and 2.