Salesforce移动推送通知以响应本机

时间:2020-01-30 06:20:34

标签: react-native react-native-android react-native-ios

我正在尝试使用https://www.npmjs.com/package/react-native-marketingcloudsdk集成salesforce SDK来进行移动推送通知和本机响应,我正在android real设备上运行该应用程序。但是,应用程序崩溃而没有任何错误日志。这是我的App.js

import React from 'react';
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  View,
  Text,
  StatusBar,
} from 'react-native';
import RegisterComponent from './RegistrationComponent';
import LogginComponent from './LoggingComponent';
import MCReactModule from 'react-native-marketingcloudsdk';

export default class App extends React.Component {

  componentDidMount = async () => {
    alert('contactKey')
    let contactKey = await MCReactModule.getContactKey();
    alert(contactKey)
  };

  render() {
    return (
      <ScrollView>
        <View style={{flex: 1, flexDirection: 'column', padding: 8}}>
          <Text>working</Text>
        </View>
      </ScrollView>
    );
  }
}

请帮助。

1 个答案:

答案 0 :(得分:0)

对不起,我在这个问题上束手无策。但是您可以使用React Native Firebase进行推送通知。