Customize Text Messages

Personalize the invite and wave messages that the StreamLayer iOS SDK sends on behalf of your users.

The StreamLayer SDK sends messages on behalf of users when they invite friends or "wave" at online contacts. You can customize these messages through the SLROverlayDelegate to match your app's voice and include relevant context.

shareInviteMessage

Returns the text used when a user shares an invite link. The SDK automatically appends a Branch.io deep link to the end of the message, so your text should end naturally without a URL.

waveMessage

Returns the text used when a user "waves" at a friend from the Who's Online panel. This message typically includes the teams or event currently being watched.

Implementation Example

SLRVideoPlayer: SLROverlayDelegate {

...

  public func shareInviteMessage() -> String {
    return "You have received a test message from StreamLayer. Please disregard. Thanks"
  }

  public func waveMessage() -> String {
    let clientApp = Bundle.main.infoDictionary![kCFBundleNameKey as String] as? String ?? ""
    let overlayState = StreamLayer.shared.redux.state.overlayState
    let awayTeamName = "Manchester United"
    let homeTeamName = "Barcelona"

    return """
           Hey! I'm watching the \(awayTeamName) vs \(homeTeamName) game right now in \
           the \(clientApp) app new interactive group viewing features. Let's hang out and watch together!
           """
  }

...

}

Related

  • Who's Online — The friend indicator that triggers wave messages